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.

Classes

ContentType

This class provides constants for commonly used Content-Type header values in HTTP requests and responses.

HttpAuthorization

Represents the value of an HTTP Authorization header.

HttpHeader

Represents a single header within an HTTP request or response.

HttpHeaderName

Represents HTTP header names for multiple versions of HTTP.

HttpHeaders

Represents a collection of headers on an HTTP request or response.

HttpPipeline

The HTTP pipeline through which HTTP requests and responses flow.

HttpPipelineBuilder

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.

HttpPipelineCallContext

Represents the context for a single HTTP request in the HTTP pipeline.

HttpPipelineNextPolicy

A class that invokes the next policy in the HTTP pipeline.

HttpPipelineNextSyncPolicy

A class that invokes the next policy in the HTTP pipeline in a synchronous manner.

HttpRange

Represents a range of bytes within an HTTP resource.

HttpRequest

Represents an outgoing HTTP request.

HttpResponse

Represents an incoming HTTP response.

MatchConditions

Specifies HTTP options for conditional requests based on ETag matching.

ProxyOptions

Represents the proxy configuration to be used in HTTP clients.

RequestConditions

Specifies HTTP options for conditional requests based on modification time and ETag matching.

Interfaces

HttpClient

A generic interface for sending HTTP requests and getting responses.

HttpClientProvider

An interface to be implemented by any azure-core plugin that wishes to provide an alternate HttpClient implementation.

Enums

HttpMethod

Represents the HTTP methods that can be used in a request.

HttpPipelinePosition

Enum representing the position in an HttpPipeline to place an HttpPipelinePolicy.

ProxyOptions.Type

The type of the proxy.