<PackageReference Include="Azure.Core" Version="1.44.0" />

HttpMessage

public sealed class HttpMessage : IDisposable
Represents a context flowing through the HttpPipeline.
public bool BufferResponse { get; set; }

Gets or sets the value indicating if response would be buffered as part of the pipeline. Defaults to true.

The CancellationToken to be used during the HttpMessage processing.

public bool HasResponse { get; }

Gets the value indicating if the response is set on this message.

public TimeSpan? NetworkTimeout { get; set; }

Gets or sets the network timeout value for this message. If null the value provided in NetworkTimeout would be used instead. Defaults to null.

The processing context for the message.

public Request Request { get; }

Gets the Request associated with this message.

public Response Response { get; set; }

Gets the Response associated with this message. Throws an exception if it wasn't set yet. To avoid the exception use HasResponse property to check.

The ResponseClassifier instance to use for response classification during pipeline invocation.

public HttpMessage(Request request, ResponseClassifier responseClassifier)

Creates a new instance of HttpMessage.

public void Dispose()

Disposes the request and response.

Returns the response content stream and releases it ownership to the caller. After calling this methods using ContentStream or Content would result in exception.

public void SetProperty(string name, object value)

Sets a property that modifies the pipeline behavior. Please refer to individual policies documentation on what properties it supports.

public void SetProperty(Type type, object value)

Sets a property that is stored with this HttpMessage instance and can be used for modifying pipeline behavior. Internal properties can be keyed with internal types to prevent external code from overwriting these values.

public bool TryGetProperty(string name, out object value)

Gets a property that modifies the pipeline behavior. Please refer to individual policies documentation on what properties it supports.

public bool TryGetProperty(Type type, out object value)

Gets a property that is stored with this HttpMessage instance and can be used for modifying pipeline behavior.