Interface HttpClient


  • public interface HttpClient
    A generic interface for sending HTTP requests and getting responses.
    • 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 the request 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.