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.
ExceptionsIn a set operation, DefaultRequestVersion
is null
.
The HttpClient instance has already started one or more requests.
The HttpClient instance has already been disposed.
RemarksDefaultRequestVersion
is HttpVersion.Version11 by default.
The DefaultRequestVersion
property specifies the default HTTP version to use for requests sent using this HttpClient instance when it constructs the HttpRequestMessage to send, specifically with calls to methods such as DeleteAsync, GetAsync, GetByteArrayAsync, GetStreamAsync, GetStringAsync, PatchAsync, PostAsync, and PutAsync.
The DefaultRequestVersion
property doesn't apply to the SendAsync method. The HttpRequestMessage parameter passed as the argument to the SendAsync method has its own Version
property that controls the HTTP version used for the request.
The DefaultRequestVersion
property can be changed as long as the HttpClient instance has not started any request.
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide. In this articleWas this page helpful?
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4