public class SyncHttpClient extends AsyncHttpClient
AsyncHttpClient
DEFAULT_MAX_CONNECTIONS, DEFAULT_MAX_RETRIES, DEFAULT_RETRY_SLEEP_TIME_MILLIS, DEFAULT_SOCKET_BUFFER_SIZE, DEFAULT_SOCKET_TIMEOUT, ENCODING_GZIP, HEADER_ACCEPT_ENCODING, HEADER_CONTENT_DISPOSITION, HEADER_CONTENT_ENCODING, HEADER_CONTENT_RANGE, HEADER_CONTENT_TYPE, LOG_TAG
Constructor and Description |
---|
SyncHttpClient()
Creates a new SyncHttpClient with default constructor arguments values
|
SyncHttpClient(boolean fixNoHttpResponseException,
int httpPort,
int httpsPort)
Creates new SyncHttpClient using given params
|
SyncHttpClient(int httpPort)
Creates a new SyncHttpClient.
|
SyncHttpClient(int httpPort,
int httpsPort)
Creates a new SyncHttpClient.
|
SyncHttpClient(org.apache.http.conn.scheme.SchemeRegistry schemeRegistry)
Creates a new SyncHttpClient.
|
Modifier and Type | Method and Description |
---|---|
protected RequestHandle |
sendRequest(org.apache.http.impl.client.DefaultHttpClient client,
org.apache.http.protocol.HttpContext httpContext,
org.apache.http.client.methods.HttpUriRequest uriRequest,
java.lang.String contentType,
ResponseHandlerInterface responseHandler,
android.content.Context context)
Puts a new request in queue as a new thread in pool to be executed
|
addHeader, allowRetryExceptionClass, blockRetryExceptionClass, cancelAllRequests, cancelRequests, clearBasicAuth, clearCredentialsProvider, createConnectionManager, delete, delete, delete, delete, delete, delete, endEntityViaReflection, get, get, get, get, get, get, getConnectTimeout, getDefaultThreadPool, getHttpClient, getHttpContext, getMaxConnections, getResponseTimeout, getThreadPool, getTimeout, getURI, getUrlWithQueryString, head, head, head, head, head, isInputStreamGZIPCompressed, isUrlEncodingEnabled, newAsyncHttpRequest, patch, patch, patch, patch, patch, post, post, post, post, post, post, put, put, put, put, put, removeAllHeaders, removeHeader, setAuthenticationPreemptive, setBasicAuth, setBasicAuth, setBasicAuth, setBasicAuth, setConnectTimeout, setCookieStore, setCredentials, setEnableRedirects, setEnableRedirects, setEnableRedirects, setMaxConnections, setMaxRetriesAndTimeout, setProxy, setProxy, setRedirectHandler, setResponseTimeout, setSSLSocketFactory, setThreadPool, setTimeout, setURLEncodingEnabled, setUserAgent, silentCloseInputStream, silentCloseOutputStream
public SyncHttpClient()
public SyncHttpClient(int httpPort)
httpPort
- non-standard HTTP-only portpublic SyncHttpClient(int httpPort, int httpsPort)
httpPort
- non-standard HTTP-only porthttpsPort
- non-standard HTTPS-only portpublic SyncHttpClient(boolean fixNoHttpResponseException, int httpPort, int httpsPort)
fixNoHttpResponseException
- Whether to fix or not issue, by ommiting SSL verificationhttpPort
- HTTP port to be used, must be greater than 0httpsPort
- HTTPS port to be used, must be greater than 0public SyncHttpClient(org.apache.http.conn.scheme.SchemeRegistry schemeRegistry)
schemeRegistry
- SchemeRegistry to be usedprotected RequestHandle sendRequest(org.apache.http.impl.client.DefaultHttpClient client, org.apache.http.protocol.HttpContext httpContext, org.apache.http.client.methods.HttpUriRequest uriRequest, java.lang.String contentType, ResponseHandlerInterface responseHandler, android.content.Context context)
AsyncHttpClient
sendRequest
in class AsyncHttpClient
client
- HttpClient to be used for request, can differ in single requestshttpContext
- HttpContext in which the request will be executeduriRequest
- instance of HttpUriRequest, which means it must be of HttpDelete,
HttpPost, HttpGet, HttpPut, etc.contentType
- MIME body type, for POST and PUT requests, may be nullresponseHandler
- ResponseHandler or its subclass to put the response intocontext
- Context of Android application, to hold the reference of request