Skip to content

Commit e392492

Browse files
davidshstephentoub
authored andcommitted
Fix HttpClient.DefaultRequestVersion property (#3359)
* Fix HttpClient.DefaultRequestVersion property Update remarks for DefaultRequestVersion to show that it doesn't apply for HttpClient.SendAsync method. Fixes https://github.com/dotnet/corefx/issues/41836 * Update xml/System.Net.Http/HttpClient.xml Co-Authored-By: Maira Wenzel <[email protected]> * Update xml/System.Net.Http/HttpClient.xml Co-Authored-By: Stephen Toub <[email protected]>
1 parent 7b01e1f commit e392492

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

xml/System.Net.Http/HttpClient.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,9 @@ The environment variables used for `DefaultProxy` initialization on Windows and
482482
## Remarks
483483
`DefaultRequestVersion` is <xref:System.Net.HttpVersion.Version11?displayProperty=nameWithType> by default.
484484
485-
The `DefaultRequestVersion` property specifies the default HTTP version to use for any requests sent using this <xref:System.Net.Http.HttpClient> instance, such as calls to <xref:System.Net.Http.HttpClient.GetAsync%2A>, <xref:System.Net.Http.HttpClient.GetStringAsync%2A>, or <xref:System.Net.Http.HttpClient.SendAsync%2A>.
485+
The `DefaultRequestVersion` property specifies the default HTTP version to use for requests sent using this <xref:System.Net.Http.HttpClient> instance when it constructs the <xref:System.Net.Http.HttpRequestMessage> to send, specifically with calls to methods such as <xref:System.Net.Http.HttpClient.DeleteAsync%2A>, <xref:System.Net.Http.HttpClient.GetAsync%2A>, <xref:System.Net.Http.HttpClient.GetByteArrayAsync%2A>, <xref:System.Net.Http.HttpClient.GetStreamAsync%2A>, <xref:System.Net.Http.HttpClient.GetStringAsync%2A>, <xref:System.Net.Http.HttpClient.PatchAsync%2A>, <xref:System.Net.Http.HttpClient.PostAsync%2A>, and <xref:System.Net.Http.HttpClient.PutAsync%2A>.
486+
487+
The `DefaultRequestVersion` property doesn't apply to the <xref:System.Net.Http.HttpClient.SendAsync%2A> method. The <xref:System.Net.Http.HttpRequestMessage> parameter passed as the argument to the <xref:System.Net.Http.HttpClient.SendAsync%2A> method has its own `Version` property that controls the HTTP version used for the request.
486488
487489
The `DefaultRequestVersion` property can be changed as long as the <xref:System.Net.Http.HttpClient> instance has not started any request.
488490
]]></format>

0 commit comments

Comments
 (0)