| Modifier and Type | Field and Description |
|---|---|
private static java.lang.String |
HEADER_CONTENT_TYPE |
protected khandroid.ext.apache.http.client.HttpClient |
mClient |
| Constructor and Description |
|---|
ExtHttpClientStack(khandroid.ext.apache.http.client.HttpClient client) |
| Modifier and Type | Method and Description |
|---|---|
private static void |
addHeaders(khandroid.ext.apache.http.client.methods.HttpUriRequest httpRequest,
java.util.Map<java.lang.String,java.lang.String> headers) |
private org.apache.http.HttpEntity |
convertEntityNewToOld(khandroid.ext.apache.http.HttpEntity ent) |
private org.apache.http.Header |
convertheaderNewToOld(khandroid.ext.apache.http.Header header) |
private org.apache.http.HttpResponse |
convertResponseNewToOld(khandroid.ext.apache.http.HttpResponse resp) |
(package private) static khandroid.ext.apache.http.client.methods.HttpUriRequest |
createHttpRequest(Request<?> request,
java.util.Map<java.lang.String,java.lang.String> additionalHeaders)
Creates the appropriate subclass of HttpUriRequest for passed in request.
|
private static java.util.List<khandroid.ext.apache.http.NameValuePair> |
getPostParameterPairs(java.util.Map<java.lang.String,java.lang.String> postParams) |
protected void |
onPrepareRequest(khandroid.ext.apache.http.client.methods.HttpUriRequest request)
Called before the request is executed using the underlying HttpClient.
|
org.apache.http.HttpResponse |
performRequest(Request<?> request,
java.util.Map<java.lang.String,java.lang.String> additionalHeaders)
Performs an HTTP request with the given parameters.
|
private static void |
setEntityIfNonEmptyBody(khandroid.ext.apache.http.client.methods.HttpEntityEnclosingRequestBase httpRequest,
Request<?> request) |
protected final khandroid.ext.apache.http.client.HttpClient mClient
private static final java.lang.String HEADER_CONTENT_TYPE
public ExtHttpClientStack(khandroid.ext.apache.http.client.HttpClient client)
private static void addHeaders(khandroid.ext.apache.http.client.methods.HttpUriRequest httpRequest,
java.util.Map<java.lang.String,java.lang.String> headers)
private static java.util.List<khandroid.ext.apache.http.NameValuePair> getPostParameterPairs(java.util.Map<java.lang.String,java.lang.String> postParams)
public org.apache.http.HttpResponse performRequest(Request<?> request, java.util.Map<java.lang.String,java.lang.String> additionalHeaders) throws java.io.IOException, AuthFailureError
HttpStackA GET request is sent if request.getPostBody() == null. A POST request is sent otherwise, and the Content-Type header is set to request.getPostBodyContentType().
performRequest in interface HttpStackrequest - the request to performadditionalHeaders - additional headers to be sent together with
Request.getHeaders()java.io.IOExceptionAuthFailureErrorprivate org.apache.http.HttpResponse convertResponseNewToOld(khandroid.ext.apache.http.HttpResponse resp)
throws java.lang.IllegalStateException,
java.io.IOException
java.lang.IllegalStateExceptionjava.io.IOExceptionprivate org.apache.http.HttpEntity convertEntityNewToOld(khandroid.ext.apache.http.HttpEntity ent)
throws java.lang.IllegalStateException,
java.io.IOException
java.lang.IllegalStateExceptionjava.io.IOExceptionprivate org.apache.http.Header convertheaderNewToOld(khandroid.ext.apache.http.Header header)
static khandroid.ext.apache.http.client.methods.HttpUriRequest createHttpRequest(Request<?> request, java.util.Map<java.lang.String,java.lang.String> additionalHeaders) throws AuthFailureError
AuthFailureErrorprivate static void setEntityIfNonEmptyBody(khandroid.ext.apache.http.client.methods.HttpEntityEnclosingRequestBase httpRequest,
Request<?> request)
throws AuthFailureError
AuthFailureErrorprotected void onPrepareRequest(khandroid.ext.apache.http.client.methods.HttpUriRequest request)
throws java.io.IOException
Overwrite in subclasses to augment the request.
java.io.IOException