Class HttpClientPipelineTransport
An implementation of PipelineTransport that uses a System.Net.Http.HttpClient to send and receive HTTP requests and responses.
Inherited Members
Namespace: System.Dynamic.ExpandoObject
Assembly: System.ClientModel.dll
Syntax
[System.Runtime.CompilerServices.Nullable(0)]
[System.Runtime.CompilerServices.NullableContext(1)]
public class HttpClientPipelineTransport : System.ClientModel.Primitives.PipelineTransport, IDisposable
Constructors
HttpClientPipelineTransport()
Create a new instance of HttpClientPipelineTransport that uses a shared default instance of System.Net.Http.HttpClient.
Declaration
public HttpClientPipelineTransport ();
HttpClientPipelineTransport(HttpClient)
Create a new instance of HttpClientPipelineTransport that uses the provided System.Net.Http.HttpClient.
Declaration
public HttpClientPipelineTransport (System.Net.Http.HttpClient client);
Parameters
System.Net.Http.HttpClient
client
The System.Net.Http.HttpClient that this transport instance will use to send and receive HTTP requests and responses. |
HttpClientPipelineTransport(HttpClient, Boolean, ILoggerFactory)
Create a new instance of HttpClientPipelineTransport that uses the provided System.Net.Http.HttpClient.
Declaration
[System.Runtime.CompilerServices.NullableContext(2)]
public HttpClientPipelineTransport (System.Net.Http.HttpClient client, bool enableLogging, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory);
Parameters
System.Net.Http.HttpClient
client
The System.Net.Http.HttpClient that this transport instance will use to send and receive HTTP requests and responses. If no System.Net.Http.HttpClient is passed, a default shared client will be used. |
System.Boolean
enableLogging
If client-wide logging is enabled for this pipeline. |
Microsoft.Extensions.Logging.ILoggerFactory
loggerFactory
The Microsoft.Extensions.Logging.ILoggerFactory to use to create an Microsoft.Extensions.Logging.ILogger instance for logging. |
Properties
Shared
Methods
CreateMessageCore()
Creates a new transport-specific instance of PipelineMessage. Types that derive from PipelineTransport must implement this method to provide transport-specific functionality.
Declaration
protected override System.ClientModel.Primitives.PipelineMessage CreateMessageCore ();
Returns
PipelineMessage
A PipelineMessage that can be passed to Process(PipelineMessage). |
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public void Dispose ();
Dispose(Boolean)
Releases the unmanaged resources used by the HttpClientPipelineTransport and optionally disposes of the managed resources.
Declaration
protected virtual void Dispose (bool disposing);
Parameters
System.Boolean
disposing
|
OnReceivedResponse(PipelineMessage, HttpResponseMessage)
A method that can be overridden by derived types to extend the default HttpClientPipelineTransport logic. It is called from ProcessCore(PipelineMessage) after the transport has created the PipelineResponse and set it on Response.
Declaration
protected virtual void OnReceivedResponse (System.ClientModel.Primitives.PipelineMessage message, System.Net.Http.HttpResponseMessage httpResponse);
Parameters
PipelineMessage
message
The PipelineMessage containing the PipelineResponse created by the transport. |
System.Net.Http.HttpResponseMessage
httpResponse
The System.Net.Http.HttpResponseMessage returned by from the call to Send on System.Net.Http.HttpClient that the transport used to create Response. |
OnSendingRequest(PipelineMessage, HttpRequestMessage)
A method that can be overridden by derived types to extend the default HttpClientPipelineTransport logic. It is called from ProcessCore(PipelineMessage) prior to sending the HTTP request.
Declaration
protected virtual void OnSendingRequest (System.ClientModel.Primitives.PipelineMessage message, System.Net.Http.HttpRequestMessage httpRequest);
Parameters
PipelineMessage
message
The PipelineMessage containing the PipelineRequest resulting from the processing of the policies in the ClientPipeline containing this transport. |
System.Net.Http.HttpRequestMessage
httpRequest
The System.Net.Http.HttpRequestMessage created by the transport that will be sent to the service using this transport's System.Net.Http.HttpClient instance. |
ProcessCore(PipelineMessage)
Transport-specific implementation used to sends the HTTP request contained by Request and set the value of Response. Types that derive from PipelineTransport must implement this method to provide transport-specific functionality.
Declaration
protected override sealed void ProcessCore (System.ClientModel.Primitives.PipelineMessage message);
Parameters
PipelineMessage
message
The PipelineMessage containing the request that was sent and response that was received by the transport. |
ProcessCoreAsync(PipelineMessage)
Transport-specific implementation used to sends the HTTP request contained by Request and set the value of Response. Types that derive from PipelineTransport must implement this method to provide transport-specific functionality.
Declaration
[System.Diagnostics.DebuggerStepThrough]
protected override sealed System.Threading.Tasks.ValueTask ProcessCoreAsync (System.ClientModel.Primitives.PipelineMessage message);
Parameters
PipelineMessage
message
The PipelineMessage containing the request that was sent and response that was received by the transport. |
Returns
System.Threading.Tasks.ValueTask
|