HttpClient.DefaultRequestVersion HttpClient.DefaultRequestVersion HttpClient.DefaultRequestVersion HttpClient.DefaultRequestVersion Property

Definition

Gets or sets the default HTTP version used on subsequent requests made by this HttpClient instance.

public:
 property Version ^ DefaultRequestVersion { Version ^ get(); void set(Version ^ value); };
public Version DefaultRequestVersion { get; set; }
member this.DefaultRequestVersion : Version with get, set
Public Property DefaultRequestVersion As Version

Property Value

The default version to use for any requests made with this HttpClient instance.

Exceptions

In a set operation, DefaultRequestVersion is null.

Remarks

DefaultRequestVersion is HttpVersion.Version11 by default.

The DefaultRequestVersion property specifies the default HTTP version to use for any requests sent using this HttpClient instance, such as calls to GetAsync, GetStringAsync, or SendAsync.

The DefaultRequestVersion property can be changed as long as the HttpClient instance has not started any request.

Applies to