Skip to content

Commit 0f4a8a6

Browse files
aik-jahodagewarren
andauthored
Add remarks about modifying properties (#3976)
* Add remarks about modifying properties * Update xml/System.Net.Http/HttpClient.xml Co-Authored-By: Genevieve Warren <[email protected]> * Reword remark Co-authored-by: Genevieve Warren <[email protected]>
1 parent 891ff66 commit 0f4a8a6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

xml/System.Net.Http/HttpClient.xml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@
3636
By default on .NET Framework and Mono, <xref:System.Net.HttpWebRequest> is used to send requests to the server. This behavior can be modified by specifying a different channel in one of the constructor overloads taking a <xref:System.Net.Http.HttpMessageHandler> instance as parameter. If features like authentication or caching are required, <xref:System.Net.Http.WebRequestHandler> can be used to configure settings and the instance can be passed to the constructor. The returned handler can be passed to one of the constructor overloads taking a <xref:System.Net.Http.HttpMessageHandler> parameter.
3737
3838
If an app using <xref:System.Net.Http.HttpClient> and related classes in the <xref:System.Net.Http> namespace intends to download large amounts of data (50 megabytes or more), then the app should stream those downloads and not use the default buffering. If the default buffering is used the client memory usage will get very large, potentially resulting in substantially reduced performance.
39-
39+
40+
Properties of <xref:System.Net.Http.HttpClient> should not be modified while there are outstanding requests, because it is not thread-safe.
41+
42+
4043
The following methods are thread safe:
4144
4245
1. <xref:System.Net.Http.HttpClient.CancelPendingRequests%2A>
@@ -455,7 +458,7 @@ The environment variables used for `DefaultProxy` initialization on Windows and
455458
<format type="text/markdown"><![CDATA[
456459
457460
## Remarks
458-
Headers set on this property don't need to be set on request messages again.
461+
Headers set on this property don't need to be set on request messages again. `DefaultRequestHeaders` should not be modified while there are outstanding requests, because it is not thread-safe.
459462
460463
]]></format>
461464
</remarks>

0 commit comments

Comments
 (0)