-
- All Implemented Interfaces:
-
apptentive.com.android.network.HttpClient
public final class DefaultHttpClient implements HttpClient
Concrete implementation of the async HTTP-request dispatcher.
-
-
Constructor Summary
Constructors Constructor Description DefaultHttpClient(HttpNetwork network, ExecutorQueue networkQueue, Executor callbackExecutor, HttpRequestRetryPolicy retryPolicy, HttpClientListener listener, HttpLoggingInterceptor loggingInterceptor)
-
Method Summary
Modifier and Type Method Description <T extends Any> Unitsend(HttpRequest<T> request, Function1<Result<HttpResponse<T>>, Unit> callback)Sends HTTP-request asynchronously. -
-
Constructor Detail
-
DefaultHttpClient
DefaultHttpClient(HttpNetwork network, ExecutorQueue networkQueue, Executor callbackExecutor, HttpRequestRetryPolicy retryPolicy, HttpClientListener listener, HttpLoggingInterceptor loggingInterceptor)
- Parameters:
network- underlying HTTP-network implementation.networkQueue- execution queue used for sync request dispatching.retryPolicy- default retry policy for HTTP-request with no custom policy.listener- optional HttpClientListener for tracking status of the requests.
-
-
Method Detail
-
send
<T extends Any> Unit send(HttpRequest<T> request, Function1<Result<HttpResponse<T>>, Unit> callback)
Sends HTTP-request asynchronously.
- Parameters:
request- request to be sent.callback- callback with a Result type to be invoked upon completion
-
-
-
-