Table of Contents

Class RequestOptions

Namespace
Microsoft.Azure.Cosmos
Assembly
Microsoft.Azure.Cosmos.Client.dll

The default cosmos request options

public class RequestOptions
Inheritance
RequestOptions
Derived
Inherited Members
Extension Methods

Constructors

RequestOptions()

public RequestOptions()

Properties

AddRequestHeaders

Gets or sets a delegate which injects/appends a custom header in the request.

public Action<Headers> AddRequestHeaders { get; set; }

Property Value

Action<Headers>

IfMatchEtag

Gets or sets the If-Match (ETag) associated with the request in the Azure Cosmos DB service.

public string IfMatchEtag { get; set; }

Property Value

string

Remarks

Most commonly used with the Delete* and Replace* methods of Container such as ReplaceItemAsync<T>(T, string, PartitionKey?, ItemRequestOptions, CancellationToken) but can be used with other methods like ReadItemAsync<T>(string, PartitionKey, ItemRequestOptions, CancellationToken) for caching scenarios.

IfNoneMatchEtag

Gets or sets the If-None-Match (ETag) associated with the request in the Azure Cosmos DB service.

public string IfNoneMatchEtag { get; set; }

Property Value

string

Remarks

Most commonly used to detect changes to the resource

PriorityLevel

Gets or sets the priority level for a request.

public PriorityLevel? PriorityLevel { get; set; }

Property Value

PriorityLevel?

Remarks

Setting priority level only has an effect if Priority Based Execution is enabled. If it is not enabled, the priority level is ignored by the backend. Default PriorityLevel for each request is treated as High. It can be explicitly set to Low for some requests. When Priority based execution is enabled, if there are more requests than the configured RU/S in a second, then Cosmos DB will throttle low priority requests to allow high priority requests to execute. This does not limit the throughput available to each priority level. Each priority level can consume the complete provisioned throughput in absence of the other. If both priorities are present and the user goes above the configured RU/s, low priority requests start getting throttled first to allow execution of mission critical workloads.

See Also

Properties

Application opted Cosmos request context that flow through with the RequestMessage. Context will be available through handlers.

public IReadOnlyDictionary<string, object> Properties { get; set; }

Property Value

IReadOnlyDictionary<string, object>

Methods

ShallowCopy()

Clone RequestOptions.

public RequestOptions ShallowCopy()

Returns

RequestOptions

cloned RequestOptions.