com.android.volley.toolbox
Class HttpClientStack

java.lang.Object
  extended by com.android.volley.toolbox.HttpClientStack
All Implemented Interfaces:
HttpStack

public class HttpClientStack
extends Object
implements HttpStack

An HttpStack that performs request over an HttpClient.


Field Summary
protected  HttpClient mClient
           
 
Constructor Summary
HttpClientStack(HttpClient client)
           
 
Method Summary
(package private) static HttpUriRequest createHttpRequest(Request<?> request, Map<String,String> additionalHeaders)
          Creates the appropriate subclass of HttpUriRequest for passed in request.
protected  void onPrepareRequest(HttpUriRequest request)
          Called before the request is executed using the underlying HttpClient.
 HttpResponse performRequest(Request<?> request, Map<String,String> additionalHeaders)
          Performs an HTTP request with the given parameters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mClient

protected final HttpClient mClient
Constructor Detail

HttpClientStack

public HttpClientStack(HttpClient client)
Method Detail

performRequest

public HttpResponse performRequest(Request<?> request,
                                   Map<String,String> additionalHeaders)
                            throws IOException,
                                   AuthFailureError
Description copied from interface: HttpStack
Performs an HTTP request with the given parameters.

A GET request is sent if request.getPostBody() == null. A POST request is sent otherwise, and the Content-Type header is set to request.getPostBodyContentType().

Specified by:
performRequest in interface HttpStack
Parameters:
request - the request to perform
additionalHeaders - additional headers to be sent together with Request.getHeaders()
Returns:
the HTTP response
Throws:
IOException
AuthFailureError

createHttpRequest

static HttpUriRequest createHttpRequest(Request<?> request,
                                        Map<String,String> additionalHeaders)
                                 throws AuthFailureError
Creates the appropriate subclass of HttpUriRequest for passed in request.

Throws:
AuthFailureError

onPrepareRequest

protected void onPrepareRequest(HttpUriRequest request)
                         throws IOException
Called before the request is executed using the underlying HttpClient.

Overwrite in subclasses to augment the request.

Throws:
IOException