Class HttpPipeline


  • public final class HttpPipeline
    extends java.lang.Object
    The HTTP pipeline that HTTP requests and corresponding responses will flow through.

    The HTTP pipeline may apply a set of HttpPipelinePolicies to the request before it is sent and on the response as it is being returned.

    See Also:
    HttpPipelinePolicy
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      HttpClient getHttpClient()
      Get the HttpClient associated with the pipeline.
      HttpPipelinePolicy getPolicy​(int index)
      Get the policy at the provided index in the pipeline.
      void send​(HttpRequest httpRequest, com.azure.android.core.util.RequestContext requestContext, com.azure.android.core.util.CancellationToken cancellationToken, HttpCallback httpCallback)
      Execute an HTTP call by sending the request through the HTTP pipeline.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • send

        public void send​(HttpRequest httpRequest,
                         com.azure.android.core.util.RequestContext requestContext,
                         com.azure.android.core.util.CancellationToken cancellationToken,
                         HttpCallback httpCallback)
        Execute an HTTP call by sending the request through the HTTP pipeline.
        Parameters:
        httpRequest - The HTTP request to send.
        requestContext - The context that is passed through the HTTP pipeline. The pipeline policies may inspect the context for any settings specific to the policy. The policies that want to make Azure SDK API calls may have to provide this context or a context derived from it (via RequestContext.addData(Object, Object)) to the API.
        cancellationToken - The cancellation token for the HTTP call, on which the caller may request cancellation of this HTTP call execution. Note that cancellation is best effort hence not guaranteed.
        httpCallback - The HTTP callback to notify the result of the HTTP call.
      • getPolicy

        public HttpPipelinePolicy getPolicy​(int index)
        Get the policy at the provided index in the pipeline.
        Parameters:
        index - index of the the policy to retrieve.
        Returns:
        the policy stored at that index.
      • getHttpClient

        public HttpClient getHttpClient()
        Get the HttpClient associated with the pipeline.
        Returns:
        the HttpClient associated with the pipeline