Skip to content

Commit d20148e

Browse files
jozkeeRon Petrusha
andcommitted
Added documentation for System.Net.Http properties targeted for 3.0 (#2733)
* Added documentation for System.Net.Http properties * Addressed PR comments. Reworded DefaultProxy platform-specific configuration. * Apply suggestions from code review * Applying lexical suggestions. * replaced OSX for macOS and Unix for Linux. Co-Authored-By: Ron Petrusha <[email protected]>
1 parent 70ac4b1 commit d20148e

File tree

2 files changed

+60
-12
lines changed

2 files changed

+60
-12
lines changed

xml/System.Net.Http/HttpClient.xml

Lines changed: 44 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -368,9 +368,32 @@ The specified `handler` will be disposed of by calling [HttpClient.Dispose](xref
368368
<ReturnType>System.Net.IWebProxy</ReturnType>
369369
</ReturnValue>
370370
<Docs>
371-
<summary>To be added.</summary>
372-
<value>To be added.</value>
373-
<remarks>To be added.</remarks>
371+
<summary>Gets or sets the global Http proxy.</summary>
372+
<value>A proxy used by every call that instantiates a <see cref="T:System.Net.HttpWebRequest" />.</value>
373+
<remarks>
374+
<format type="text/markdown"><![CDATA[
375+
376+
## Remarks
377+
This static property determines the default proxy that all <xref:System.Net.Http.HttpClient> instances use if no proxy is set explicitly in the <xref:System.Net.Http.HttpClientHandler> passed through its constructor.
378+
379+
The default instance returned by this property will initialize following a different set of rules depending on your platform:
380+
* **For Windows:** Reads proxy configuration from environment variables or, if those are not defined, from the user's proxy settings.
381+
382+
* **For macOS:** Reads proxy configuration from environment variables or, if those are not defined, from the system's proxy settings.
383+
384+
* **For Linux:** Reads proxy configuration from environment variables or, in case those are not defined, this property initializes a non-configured instance that bypasses all addresses.
385+
386+
The environment variables used for `DefaultProxy` initialization on Windows and Unix-based platforms are:
387+
* HTTP_PROXY: the hostname or IP address of the proxy server used on HTTP requests.
388+
* HTTPS_PROXY: the hostname or IP address of the proxy server used on HTTPS requests.
389+
* ALL_PROXY: the hostname or IP address of the proxy server used on HTTP and/or HTTPS requests in case HTTP_PROXY and/or HTTPS_PROXY are not defined.
390+
* NO_PROXY: a comma-separated list of hostnames that should be excluded from proxying.
391+
392+
]]></format>
393+
</remarks>
394+
<exception cref="T:System.ArgumentNullException">
395+
The value passed cannot be <see langword="null" />.
396+
</exception>
374397
</Docs>
375398
</Member>
376399
<Member MemberName="DefaultRequestHeaders">
@@ -429,10 +452,23 @@ The specified `handler` will be disposed of by calling [HttpClient.Dispose](xref
429452
<ReturnType>System.Version</ReturnType>
430453
</ReturnValue>
431454
<Docs>
432-
<summary>To be added.</summary>
433-
<value>To be added.</value>
434-
<remarks>To be added.</remarks>
435-
</Docs>
455+
<summary>Gets or sets the default HTTP version used on subsequent requests made by this <see cref="T:System.Net.Http.HttpClient" /> instance.</summary>
456+
<value>The default version to use for any requests made with this <see cref="T:System.Net.Http.HttpClient" /> instance.</value>
457+
<remarks>
458+
<format type="text/markdown"><![CDATA[
459+
460+
## Remarks
461+
`DefaultRequestVersion` is <xref:System.Net.HttpVersion.Version11?displayProperty=nameWithType> by default.
462+
463+
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>.
464+
465+
The `DefaultRequestVersion` property can be changed as long as the <xref:System.Net.Http.HttpClient> instance has not started any request.
466+
]]></format>
467+
</remarks>
468+
<exception cref="T:System.ArgumentNullException">In a set operation, <see langword="DefaultRequestVersion" /> is <see langword="null" />.</exception>
469+
<exception cref="T:System.InvalidOperationException">The <see cref="T:System.Net.Http.HttpClient" /> instance has already started one or more requests.</exception>
470+
<exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Http.HttpClient" /> instance has already been disposed.</exception>
471+
</Docs>
436472
</Member>
437473
<MemberGroup MemberName="DeleteAsync">
438474
<AssemblyInfo>
@@ -2244,4 +2280,4 @@ httpClient.Timeout = TimeSpan.FromMinutes(10);
22442280
</Docs>
22452281
</Member>
22462282
</Members>
2247-
</Type>
2283+
</Type>

xml/System.Net.Http/HttpResponseMessage.xml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -484,9 +484,21 @@
484484
<ReturnType>System.Net.Http.Headers.HttpResponseHeaders</ReturnType>
485485
</ReturnValue>
486486
<Docs>
487-
<summary>To be added.</summary>
488-
<value>To be added.</value>
489-
<remarks>To be added.</remarks>
487+
<summary>Gets the collection of trailing headers included in an HTTP response.</summary>
488+
<value>The collection of trailing headers in the HTTP response.</value>
489+
<remarks>
490+
<format type="text/markdown"><![CDATA[
491+
492+
## Remarks
493+
Forbidden headers will be ignored.
494+
495+
Since trailing headers are sent as an HTTP header appended at the end of the response message, the `TrailingHeaders` property returns an empty <xref:System.Net.Http.Headers.HttpResponseHeaders> instance if it is accessed and the response content has not been read completely.
496+
497+
For additional information on trailing headers, see [RFC 7230 - 4.1.2. Chunked Trailer Part](https://tools.ietf.org/html/rfc7230#section-4.1.2).
498+
499+
]]></format>
500+
</remarks>
501+
<exception cref="T:System.Net.Http.HttpRequestException">PROTOCOL_ERROR: The HTTP/2 response contains pseudo-headers in the Trailing Headers Frame.</exception>
490502
</Docs>
491503
</Member>
492504
<Member MemberName="Version">
@@ -520,4 +532,4 @@
520532
</Docs>
521533
</Member>
522534
</Members>
523-
</Type>
535+
</Type>

0 commit comments

Comments
 (0)