HttpRequestOptions.TryGetValue<TValue> Method

Definition

Gets the value of a specified HTTP request option.

C#
public bool TryGetValue<TValue>(System.Net.Http.HttpRequestOptionsKey<TValue> key, out TValue value);

Type Parameters

TValue

The type of the HTTP value as defined by key.

Parameters

key
HttpRequestOptionsKey<TValue>

The strongly typed key to get the value of an HTTP request option.

value
TValue

When this method returns, contains the value of the specified HTTP request option.

Returns

true if the collection contains an element with the specified key; otherwise, false.

Applies to

Product Versions
.NET 5, 6, 7, 8, 9