Package com.azure.android.core.http
Interface HttpClient
-
public interface HttpClient
A generic interface for sending HTTP requests and getting responses.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static HttpClient
createDefault()
Create defaultHttpClient
instance.HttpCallDispatcher
getHttpCallDispatcher()
Gets the dispatcher to dispatch async HTTP calls.void
send(HttpRequest httpRequest, com.azure.android.core.util.CancellationToken cancellationToken, HttpCallback httpCallback)
Send the provided request asynchronously.
-
-
-
Method Detail
-
getHttpCallDispatcher
HttpCallDispatcher getHttpCallDispatcher()
Gets the dispatcher to dispatch async HTTP calls.- Returns:
- The HTTP call dispatcher.
-
send
void send(HttpRequest httpRequest, com.azure.android.core.util.CancellationToken cancellationToken, HttpCallback httpCallback)
Send the provided request asynchronously.- Parameters:
httpRequest
- The HTTP request to send.cancellationToken
- The cancellation token for the HTTP call, on which the caller may request cancellation of therequest
execution. Note that honoring cancellation request is best effort; In HttpClient implementations, once the execution passed the point of no-cancellation, it will not honor the cancel request. This point of no-cancellation depends on each HTTP Client implementation, for some HttpClient implementations cancellation is not at all supported.httpCallback
- The HTTP callback to notify the result.
-
createDefault
static HttpClient createDefault()
Create defaultHttpClient
instance.- Returns:
- A new instance of the
HttpClient
.
-
-