İngilizce dilinde oku

Aracılığıyla paylaş


com.azure.core.http.policy

This package contains the HttpPipelinePolicy interface and its implementations. These policies are used to form an HTTP pipeline, which is a series of policies that are invoked to handle an HTTP request.

The HttpPipelinePolicy interface defines process and processSync methods. These methods transform an HTTP request into an HttpResponse asynchronously and synchronously respectively. Implementations of this interface can modify the request, pass it to the next policy, and then modify the response.

Code Sample:

In this example, the UserAgentPolicy, RetryPolicy, and CustomPolicy are added to the pipeline. The pipeline is then used to send an HTTP request, and the response is retrieved.

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

 HttpRequest request = new HttpRequest(HttpMethod.GET, new URL("http://example.com"));
 HttpResponse response = pipeline.send(request).block();

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.

Classes

AddDatePolicy

The AddDatePolicy class is an implementation of the HttpPipelinePolicy interface.

AddHeadersFromContextPolicy

The pipeline policy that override or add HttpHeaders in HttpRequest by reading values from Context with key 'azure-http-headers-key'.

AddHeadersPolicy

The AddHeadersPolicy class is an implementation of the HttpPipelinePolicy interface.

AzureKeyCredentialPolicy

The AzureKeyCredentialPolicy class is an implementation of the KeyCredentialPolicy interface.

AzureSasCredentialPolicy

The AzureSasCredentialPolicy class is an implementation of the HttpPipelinePolicy interface.

BearerTokenAuthenticationPolicy

The BearerTokenAuthenticationPolicy class is an implementation of the HttpPipelinePolicy interface.

CookiePolicy

The CookiePolicy class is an implementation of the HttpPipelinePolicy interface.

DefaultRedirectStrategy

The DefaultRedirectStrategy class is an implementation of the RedirectStrategy interface.

ExponentialBackoff

The ExponentialBackoff class is an implementation of the RetryStrategy interface.

ExponentialBackoffOptions

The ExponentialBackoffOptions class provides configuration options for the ExponentialBackoff retry strategy.

FixedDelay

The FixedDelay class is an implementation of the RetryStrategy interface.

FixedDelayOptions

The FixedDelayOptions class provides configuration options for the FixedDelay retry strategy.

HostPolicy

The HostPolicy class is an implementation of the HttpPipelinePolicy interface.

HttpLogOptions

The HttpLogOptions class provides configuration options for HTTP logging.

HttpLoggingPolicy

The HttpLoggingPolicy class is an implementation of the HttpPipelinePolicy interface.

HttpPipelineSyncPolicy

The HttpPipelineSyncPolicy class is an implementation of the HttpPipelinePolicy interface.

HttpPolicyProviders

The HttpPolicyProviders class is responsible for adding Service Provider Interface (SPI) pluggable policies to an HTTP pipeline automatically.

HttpRequestLoggingContext

The HttpRequestLoggingContext class provides contextual information available during HTTP request logging.

HttpResponseLoggingContext

The HttpResponseLoggingContext class provides contextual information available during HTTP response logging.

KeyCredentialPolicy

The KeyCredentialPolicy class is an implementation of the HttpPipelinePolicy interface.

PortPolicy

The PortPolicy class is an implementation of the HttpPipelinePolicy interface.

ProtocolPolicy

The ProtocolPolicy class is an implementation of the HttpPipelinePolicy interface.

RedirectPolicy

The RedirectPolicy class is an implementation of the HttpPipelinePolicy interface.

RequestIdPolicy

The RequestIdPolicy class is an implementation of the HttpPipelinePolicy interface.

RequestRetryCondition

Information about the request that failed, used to determine whether a retry should be attempted.

RetryOptions

The RetryOptions class provides configuration options for retry strategies.

RetryPolicy

The RetryPolicy class is an implementation of the HttpPipelinePolicy interface.

TimeoutPolicy

Deprecated

Consider configuring timeouts with HttpClientOptions.

UserAgentPolicy

The UserAgentPolicy class is an implementation of the HttpPipelinePolicy interface.

Interfaces

AfterRetryPolicyProvider

Implementing classes are automatically added as policies after the retry policy.

BeforeRetryPolicyProvider

Implementing classes are automatically added as policies before the retry policy.

HttpPipelinePolicy

A policy within the HttpPipeline.

HttpPolicyProvider

Implementing classes automatically provide policies.

HttpRequestLogger

Manages logging HTTP requests in HttpLoggingPolicy.

HttpResponseLogger

Manages logging HTTP responses in HttpLoggingPolicy.

RedirectStrategy

The interface for determining the RedirectStrategy used in RedirectPolicy.

RetryStrategy

The interface for determining the retry strategy used in RetryPolicy.

Enums

HttpLogDetailLevel

The HttpLogDetailLevel class is an enumeration of the levels of detail to log on HTTP messages.