Package com.azure.core.http


package com.azure.core.http

This package provides HTTP abstractions for Azure SDK client libraries. It serves as a bridge between the AnnotationParser, RestProxy, and the HTTP client.

Key features:

  • AnnotationParser: Interprets annotations on interface definitions and methods to construct HTTP requests.
  • RestProxy: Transforms interface definitions into live implementations that convert method invocations into network calls.
  • HTTP client: Sends HTTP requests and receives responses.

The HTTP pipeline is a series of policies that are invoked to handle an HTTP request. Each policy is a piece of code that takes an HTTP request, does some processing, and passes the request to the next policy in the pipeline. The last policy in the pipeline would then actually send the HTTP request.

Users can create a custom pipeline by creating their own policies and adding them to the pipeline. Here's a code sample:

 HttpPipeline pipeline = new HttpPipelineBuilder()
     .policies(new UserAgentPolicy(), new RetryPolicy())
     .build();
 

This package is crucial for the communication between Azure SDK client libraries and Azure services. It provides a layer of abstraction over the HTTP protocol, allowing client libraries to focus on service-specific logic. Custom pipelines can be helpful when you want to customize the behavior of HTTP requests and responses in some way, such as, to add a custom header to all requests.

See Also:
  • Class
    Description
    This class provides constants for commonly used Content-Type header values in HTTP requests and responses.
    Represents the value of an HTTP Authorization header.
    A generic interface for sending HTTP requests and getting responses.
    An interface to be implemented by any azure-core plugin that wishes to provide an alternate HttpClient implementation.
    Represents a single header within an HTTP request or response.
    Represents HTTP header names for multiple versions of HTTP.
    Represents a collection of headers on an HTTP request or response.
    Represents the HTTP methods that can be used in a request.
    The HTTP pipeline through which HTTP requests and responses flow.
    This class provides a fluent builder API to help aid the configuration and instantiation of the HttpPipeline, calling build constructs an instance of the pipeline.
    Represents the context for a single HTTP request in the HTTP pipeline.
    A class that invokes the next policy in the HTTP pipeline.
    A class that invokes the next policy in the HTTP pipeline in a synchronous manner.
    Enum representing the position in an HttpPipeline to place an HttpPipelinePolicy.
    Represents a range of bytes within an HTTP resource.
    Represents an outgoing HTTP request.
    Represents an incoming HTTP response.
    Specifies HTTP options for conditional requests based on ETag matching.
    Represents the proxy configuration to be used in HTTP clients.
    The type of the proxy.
    Specifies HTTP options for conditional requests based on modification time and ETag matching.