RequestOptions Class

Definition

Options that can be used to control the behavior of a request sent by a client.

public class RequestOptions
type RequestOptions = class
Public Class RequestOptions
Inheritance
RequestOptions

Constructors

RequestOptions()

Initializes a new instance of the RequestOptions class

Properties

BufferResponse

Gets or sets a value indicating whether the response content should be buffered in-memory by the pipeline. This value defaults to true.

CancellationToken

Gets or sets the CancellationToken used for the duration of the call to Send(PipelineMessage).

ErrorOptions

Gets or sets a value that describes when a client's service method will raise an exception if the underlying response is considered an error.

Methods

AddHeader(String, String)

Adds the specified header and its value to the request's header collection. If a header with this name is already present in the collection, the value will be added to the comma-separated list of values associated with the header.

AddPolicy(PipelinePolicy, PipelinePosition)

Adds a PipelinePolicy into the pipeline for the duration of this request.

Apply(PipelineMessage)

Apply the options provided in this RequestOptions instance to the message.

AssertNotFrozen()

Assert that Freeze() has not been called on this RequestOptions instance.

Freeze()

Freeze this instance of RequestOptions. After this method has been called, any attempt to set properties on the instance or call methods that would change its state will throw InvalidOperationException.

SetHeader(String, String)

Sets the specified header and its value in the request's header collection. If a header with this name is already present in the collection, the header's value will be replaced with the specified value.

Applies to