Class PipelineMessage
Represents an HTTP message that can be sent from a ClientPipeline. Request holds the request sent to the cloud service, and Response holds the response received from the service.
Inheritance
Namespace: System.Dynamic.ExpandoObject
Assembly: System.ClientModel.dll
Syntax
[System.Runtime.CompilerServices.Nullable(0)]
[System.Runtime.CompilerServices.NullableContext(1)]
public class PipelineMessage : IDisposable
Constructors
PipelineMessage(PipelineRequest)
Creates an instance of PipelineMessage with
Request set to the provided request
.
Declaration
protected internal PipelineMessage (System.ClientModel.Primitives.PipelineRequest request);
Parameters
PipelineRequest
request
The PipelineRequest to set on this instance's Request property. |
Properties
BufferResponse
Gets or sets the value indicating whether the response should be buffered in-memory by the pipeline. Defaults to true.
Declaration
public bool BufferResponse { get; set; }
Property Value
System.Boolean
|
CancellationToken
Gets or sets the CancellationToken used for the duration of the call to Send(PipelineMessage).
Declaration
public System.Threading.CancellationToken CancellationToken { get; protected internal set; }
Property Value
System.Threading.CancellationToken
|
NetworkTimeout
Gets or sets the network timeout value for this message.
If null
, the value set on the client's options will be used.
Defaults to null
.
Declaration
public Nullable<TimeSpan> NetworkTimeout { get; set; }
Property Value
System.Nullable<System.TimeSpan>
|
Request
Gets the PipelineRequest to send to the service during the call to Send(PipelineMessage).
Declaration
public System.ClientModel.Primitives.PipelineRequest Request { get; }
Property Value
PipelineRequest
|
Response
Gets the PipelineResponse received from the service during the call to Send(PipelineMessage).
Declaration
[System.Runtime.CompilerServices.Nullable(2)]
[get: System.Runtime.CompilerServices.NullableContext(2)]
[set: System.Runtime.CompilerServices.NullableContext(2)]
public System.ClientModel.Primitives.PipelineResponse Response { get; protected internal set; }
Property Value
PipelineResponse
|
ResponseClassifier
Gets or sets the PipelineMessageClassifier used by the ClientPipeline to determine whether the response received from the service is considered an error and populate the IsError on Response.
This property is intended to be set in a client's service method to a a PipelineMessageClassifier that classifies responses as success responses based on the service API's published success codes. Setting this value outside the service method will override the client-specified classifier and may result in undesired behavior.
Declaration
public System.ClientModel.Primitives.PipelineMessageClassifier ResponseClassifier { get; set; }
Property Value
PipelineMessageClassifier
|
Methods
Apply(RequestOptions)
Apply the options from the provided RequestOptions to this PipelineMessage instance.
Declaration
[System.Runtime.CompilerServices.NullableContext(2)]
public void Apply (System.ClientModel.Primitives.RequestOptions options);
Parameters
RequestOptions
options
The RequestOptions to apply to this
PipelineMessage instance. If |
Remarks
This method is intended to be called after the creation of the PipelineMessage and its Request is complete, and prior to the call to Send(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 PipelineMessage and optionally disposes of the managed resources.
Declaration
protected virtual void Dispose (bool disposing);
Parameters
System.Boolean
disposing
|
ExtractResponse()
Returns the value of the Response property and transfers dispose ownership of the response to the caller. After calling this method, the Response property will be
null
and the caller will be responsible for disposing the returned value,
which may hold a live network stream.
Declaration
[System.Runtime.CompilerServices.NullableContext(2)]
public System.ClientModel.Primitives.PipelineResponse ExtractResponse ();
Returns
PipelineResponse
|
SetProperty(Type, Object)
Set a property in the property bag for this PipelineMessage instance. Message properties are used to govern the behavior of specific policies in the ClientPipeline. Please refer to documentation for a specific PipelinePolicy to understand what properties it supports.
Declaration
public void SetProperty (Type key, object value);
Parameters
System.Type
key
The key for the property in the message's property bag. |
System.Object
value
The value of the property. |
TryGetProperty(Type, Object)
Attempts to get a property from the property bag for this PipelineMessage instance. Message properties are used to govern the behavior of specific policies in the ClientPipeline. Please refer to documentation for a specific PipelinePolicy to understand what properties it supports.
Declaration
public bool TryGetProperty (Type key, out object value);
Parameters
System.Type
key
The key for the property in the message's property bag. |
System.Object
value
The value of the property. |
Returns
System.Boolean
|