Skip to content

Commit e3b38ed

Browse files
Jan JahodaJan Jahodacarlossanlop
authored
Add CreateContentReadStreamAsync documentation to various Content classes (#4747)
* Add CreateContentReadStreamAsync documentation to various Content classes * Update xml/System.Net.Http/HttpContent.xml Co-authored-by: Carlos Sanchez <[email protected]> Co-authored-by: Jan Jahoda <[email protected]> Co-authored-by: Carlos Sanchez <[email protected]>
1 parent d5d8dba commit e3b38ed

File tree

2 files changed

+30
-8
lines changed

2 files changed

+30
-8
lines changed

xml/System.Net.Http/HttpContent.xml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -365,10 +365,21 @@
365365
<Parameter Name="cancellationToken" Type="System.Threading.CancellationToken" Index="0" FrameworkAlternate="net-5.0" />
366366
</Parameters>
367367
<Docs>
368-
<param name="cancellationToken">To be added.</param>
369-
<summary>To be added.</summary>
370-
<returns>To be added.</returns>
371-
<remarks>To be added.</remarks>
368+
<param name="cancellationToken">The cancellation token to cancel the operation.</param>
369+
<summary>Serializes the HTTP content to a memory stream as an asynchronous operation.</summary>
370+
<returns>The task object representing the asynchronous operation.</returns>
371+
<remarks>
372+
<format type="text/markdown"><![CDATA[
373+
374+
## Remarks
375+
This operation will not block. The returned <xref:System.Threading.Tasks.Task%601> object will complete after all of the content has been written to the memory stream.
376+
377+
Once the operation completes, the <xref:System.Threading.Tasks.Task%601.Result%2A> property on the returned task object contains the memory stream that represents the HTTP content. The returned stream can then be used to read the content using various stream APIs.
378+
379+
The <xref:System.Net.Http.HttpContent.CreateContentReadStreamAsync%2A> method buffers the content to a memory stream. Derived classes can override this behavior if there is a better way to retrieve the content as stream. For example, a byte array or a string could use a more efficient method way such as wrapping a read-only <xref:System.IO.MemoryStream> around the bytes or string.)
380+
381+
]]></format>
382+
</remarks>
372383
</Docs>
373384
</Member>
374385
<MemberGroup MemberName="Dispose">

xml/System.Net.Http/MultipartContent.xml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -279,10 +279,21 @@
279279
<Parameter Name="cancellationToken" Type="System.Threading.CancellationToken" Index="0" FrameworkAlternate="net-5.0" />
280280
</Parameters>
281281
<Docs>
282-
<param name="cancellationToken">To be added.</param>
283-
<summary>To be added.</summary>
284-
<returns>To be added.</returns>
285-
<remarks>To be added.</remarks>
282+
<param name="cancellationToken">The cancellation token to cancel the operation.</param>
283+
<summary>Serializes the HTTP content to a stream using the multipart/* encoding as an asynchronous operation.</summary>
284+
<returns>The task object representing the asynchronous operation.</returns>
285+
<remarks>
286+
<format type="text/markdown"><![CDATA[
287+
288+
## Remarks
289+
This method overrides <xref:System.Net.Http.HttpContent.CreateContentReadStreamAsync%2A?displayProperty=nameWithType> to use a custom stream that contains an array, with each HTTP content and its boundary encoded and serialized to a <xref:System.IO.MemoryStream> instance.
290+
291+
This operation will not block. The returned <xref:System.Threading.Tasks.Task%601> object will complete after all of the content has been written to the memory stream.
292+
293+
Once the operation completes, the <xref:System.Threading.Tasks.Task%601.Result%2A?displayProperty=nameWithType> property on the returned task object contains the stream that represents the multipart/* encoded HTTP content. The returned stream can then be used to read the content using various stream APIs.
294+
295+
]]></format>
296+
</remarks>
286297
</Docs>
287298
</Member>
288299
<Member MemberName="Dispose">

0 commit comments

Comments
 (0)