Skip to content

Commit 6641f97

Browse files
IanKempRon Petrusha
authored andcommitted
Add info regarding the default behaviour of the constructors with fewer args (dotnet#2530)
* add info regarding the default behaviour * Incorporated suggestions
1 parent 13c414e commit 6641f97

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

xml/System.Net.Http/HttpClient.xml

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,13 @@ public class GoodController : ApiController
194194
</AssemblyInfo>
195195
<Parameters />
196196
<Docs>
197-
<summary>Initializes a new instance of the <see cref="T:System.Net.Http.HttpClient" /> class.</summary>
198-
<remarks>To be added.</remarks>
197+
<summary>Initializes a new instance of the <see cref="T:System.Net.Http.HttpClient" /> class using a <see cref="T:System.Net.Http.HttpClientHandler" /> that is disposed when this instance is disposed.</summary>
198+
<remarks>
199+
<format type="text/markdown"><![CDATA[
200+
## Remarks
201+
Using this constructor is equivalent to calling the [`HttpClient(new HttpClientHandler(), true)`](xref:System.Net.Http.HttpClient.%23ctor(System.Net.Http.HttpMessageHandler,System.Boolean)) constructor.
202+
]]></format>
203+
</remarks>
199204
</Docs>
200205
</Member>
201206
<Member MemberName=".ctor">
@@ -224,14 +229,14 @@ public class GoodController : ApiController
224229
</Parameters>
225230
<Docs>
226231
<param name="handler">The HTTP handler stack to use for sending requests.</param>
227-
<summary>Initializes a new instance of the <see cref="T:System.Net.Http.HttpClient" /> class with a specific handler.</summary>
232+
<summary>Initializes a new instance of the <see cref="T:System.Net.Http.HttpClient" /> class with the specified handler. The handler is disposed when this instance is disposed.</summary>
228233
<remarks>
229-
<format type="text/markdown"><![CDATA[
230-
234+
<format type="text/markdown"><![CDATA[
231235
## Remarks
232-
`handler` will be disposed of by calling [HttpClient.Dispose](xref:System.Net.Http.HttpMessageInvoker.Dispose).
233-
234-
]]></format>
236+
Using this constructor is equivalent to calling the [`HttpClient(handler, true)`](xref:System.Net.Http.HttpClient.%23ctor(System.Net.Http.HttpMessageHandler,System.Boolean)) constructor.
237+
238+
The specified `handler` will be disposed of by calling [HttpClient.Dispose](xref:System.Net.Http.HttpMessageInvoker.Dispose).
239+
]]></format>
235240
</remarks>
236241
<exception cref="T:System.ArgumentNullException">The <paramref name="handler" /> is <see langword="null" />.</exception>
237242
</Docs>
@@ -264,8 +269,8 @@ public class GoodController : ApiController
264269
<Docs>
265270
<param name="handler">The <see cref="T:System.Net.Http.HttpMessageHandler" /> responsible for processing the HTTP response messages.</param>
266271
<param name="disposeHandler">
267-
<see langword="true" /> if the inner handler should be disposed of by [HttpClient.Dispose](xref:System.Net.Http.HttpMessageInvoker.Dispose), <see langword="false" /> if you intend to reuse the inner handler.</param>
268-
<summary>Initializes a new instance of the <see cref="T:System.Net.Http.HttpClient" /> class with a specific handler.</summary>
272+
<see langword="true" /> if the inner handler should be disposed of by [HttpClient.Dispose](xref:System.Net.Http.HttpMessageInvoker.Dispose); <see langword="false" /> if you intend to reuse the inner handler.</param>
273+
<summary>Initializes a new instance of the <see cref="T:System.Net.Http.HttpClient" /> class with the provided handler, and specifies whether that handler should be disposed when this instance is disposed.</summary>
269274
<remarks>To be added.</remarks>
270275
<exception cref="T:System.ArgumentNullException">The <paramref name="handler" /> is <see langword="null" />.</exception>
271276
</Docs>

0 commit comments

Comments
 (0)