<PackageReference Include="System.ClientModel" Version="1.1.0" />

RequestOptions

public class RequestOptions
Options that can be used to control the behavior of a request sent by a client.
public bool BufferResponse { get; set; }

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

public CancellationToken CancellationToken { get; set; }

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

public ClientErrorBehaviors ErrorOptions { get; set; }

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.

public RequestOptions()

Initializes a new instance of the RequestOptions class

public void AddHeader(string name, string value)

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.

public void AddPolicy(PipelinePolicy policy, PipelinePosition position)

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

protected void AssertNotFrozen()

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

public virtual void 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.

public void SetHeader(string name, string value)

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.