Class HttpPipeline | Azure SDK for Net

Represents a primitive for sending HTTP requests and receiving responses extensible by adding HttpPipelinePolicy processing steps. HttpPipeline Creates a new instance of HttpPipeline with the provided transport, policies and response classifier.

Represents a primitive for sending HTTP requests and receiving responses extensible by adding HttpPipelinePolicy processing steps.

Inheritance

HttpPipeline

Namespace: Azure.Core.Pipeline
Assembly: Azure.Core.dll
Syntax
public class HttpPipeline

Constructors

HttpPipeline(HttpPipelineTransport, HttpPipelinePolicy[], ResponseClassifier)

Creates a new instance of HttpPipeline with the provided transport, policies and response classifier.

Declaration
public HttpPipeline (Azure.Core.Pipeline.HttpPipelineTransport transport, Azure.Core.Pipeline.HttpPipelinePolicy[] policies = null, Azure.Core.ResponseClassifier responseClassifier = null);
Parameters

Properties

ResponseClassifier

Declaration
public Azure.Core.ResponseClassifier ResponseClassifier { get; }
Property Value

Methods

CreateClientRequestIdScope(String)

Creates a scope in which all outgoing requests would use the provided

Declaration
public static IDisposable CreateClientRequestIdScope (string clientRequestId);
Parameters
String clientRequestId

The client request id value to be sent with request.

Returns
IDisposable

The IDisposable instance that needs to be disposed when client request id shouldn't be sent anymore.

Examples

Sample usage:

 var secretClient = new SecretClient(new Uri("http://example.com"), new DefaultAzureCredential()); using (HttpPipeline.CreateClientRequestIdScope("<custom-client-request-id>")) { // The HTTP request resulting from the client call would have x-ms-client-request-id value set to <custom-client-request-id> secretClient.GetSecret("<secret-name>"); } 

CreateMessage()

Declaration
public Azure.Core.HttpMessage CreateMessage ();
Returns

CreateRequest()

Declaration
public Azure.Core.Request CreateRequest ();
Returns

Send(HttpMessage, CancellationToken)

Invokes the pipeline synchronously. After the task completes response would be set to the Response property.

Declaration
public void Send (Azure.Core.HttpMessage message, System.Threading.CancellationToken cancellationToken);
Parameters

SendAsync(HttpMessage, CancellationToken)

Invokes the pipeline asynchronously. After the task completes response would be set to the Response property.

Declaration
public System.Threading.Tasks.ValueTask SendAsync (Azure.Core.HttpMessage message, System.Threading.CancellationToken cancellationToken);
Parameters
Returns

SendRequest(Request, CancellationToken)

Invokes the pipeline synchronously with the provided request.

Declaration
public Azure.Response SendRequest (Azure.Core.Request request, System.Threading.CancellationToken cancellationToken);
Parameters
Returns

SendRequestAsync(Request, CancellationToken)

Invokes the pipeline asynchronously with the provided request.

Declaration
[System.Diagnostics.DebuggerStepThrough] public System.Threading.Tasks.ValueTask<Azure.Response> SendRequestAsync (Azure.Core.Request request, System.Threading.CancellationToken cancellationToken);
Parameters
Returns

ncG1vNJzZmiZqqq%2Fpr%2FDpJuom6Njr627wWeaqKqVY8SqusOorqxmnprBcHDWnplonJ%2Bpu6bAjnqxrqqVY5CwvsRoaGdrXmV8orzIaHizraKae4S70Z5liaGgmrmqusRoeLOtopp7hLvRnmWJoaCauaq6xGd%2FrayghbaxscuipZ5mmKm6rQ%3D%3D

 Share!