-
Notifications
You must be signed in to change notification settings - Fork 1.6k
HttpClient sync operations #4776
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
77399c7
680ef84
e34b691
9efb1cf
d89511d
9aad677
0b92a0b
87515ae
fd0792f
cc123b3
312f0f6
8cb69c4
e3b69dd
699d465
4188305
367674f
8000
7d65351
ced8bab
898def7
71a5890
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2686,10 +2686,31 @@ The <paramref name="requestUri" /> is not an absolute URI. | |
<Parameter Name="request" Type="System.Net.Http.HttpRequestMessage" Index="0" FrameworkAlternate="net-5.0" /> | ||
</Parameters> | ||
<Docs> | ||
<param name="request">To be added.</param> | ||
<summary>To be added.</summary> | ||
<returns>To be added.</returns> | ||
<remarks>To be added.</remarks> | ||
<param name="request">The HTTP request message to send.</param> | ||
<summary>Sends an HTTP request with the specified request.</summary> | ||
<returns>An HTTP response message.</returns> | ||
<remarks> | ||
<format type="text/markdown"><![CDATA[ | ||
|
||
## Remarks | ||
This operation blocks until the entire response, including content, is read. | ||
|
||
]]></format> | ||
</remarks> | ||
<exception cref="T:System.ArgumentNullException">The <paramref name="request" /> is <see langword="null" />.</exception> | ||
aik-jahoda marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<exception cref="T:System.NotSupportedException">The HTTP version is 2.0 or higher or the version policy is set to <see cref="F:System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher" />. | ||
|
||
-or- | ||
|
||
The custom class derived from <see cref="T:System.Net.Http.HttpContent" /> does not override the <see cref="M:System.Net.Http.HttpContent.SerializeToStream(System.IO.Stream,System.Net.TransportContext,System.Threading.CancellationToken)" /> method. | ||
|
||
-or- | ||
|
||
The custom <see cref="T:System.Net.Http.HttpMessageHandler" /> does not override the <see cref="M:System.Net.Http.HttpMessageHandler.Send(System.Net.Http.HttpRequestMessage,System.Threading.CancellationToken)" /> method.</exception> | ||
<exception cref="T:System.InvalidOperationException">The request message was already sent by the <see cref="T:System.Net.Http.HttpClient" /> instance.</exception> | ||
<exception cref="T:System.Net.Http.HttpRequestException">The request failed due to an underlying issue such as network connectivity, DNS failure, or server certificate validation.</exception> | ||
<exception cref="T:System.Threading.Tasks.TaskCanceledException">If the <see cref="T:System.Threading.Tasks.TaskCanceledException" /> exception nests the <see cref="T:System.TimeoutException" />: | ||
The request failed due to timeout.</exception> | ||
</Docs> | ||
</Member> | ||
<Member MemberName="Send"> | ||
|
@@ -2715,11 +2736,32 @@ The <paramref name="requestUri" /> is not an absolute URI. | |
<Parameter Name="completionOption" Type="System.Net.Http.HttpCompletionOption" Index="1" FrameworkAlternate="net-5.0" /> | ||
</Parameters> | ||
<Docs> | ||
<param name="request">To be added.</param> | ||
<param name="completionOption">To be added.</param> | ||
<summary>To be added.</summary> | ||
<returns>To be added.</returns> | ||
<remarks>To be added.</remarks> | ||
<param name="request">The HTTP request message to send.</param> | ||
<param name="completionOption">One of the enumeration values that specifies when the operation should complete (as soon as a response is available or after reading the response content).</param> | ||
<summary>Sends an HTTP request.</summary> | ||
<returns>The HTTP response message.</returns> | ||
<remarks> | ||
<format type="text/markdown"><![CDATA[ | ||
|
||
## Remarks | ||
This operation blocks until the entire response, including content, is read. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not true for |
||
|
||
]]></format> | ||
</remarks> | ||
<exception cref="T:System.ArgumentNullException">The <paramref name="request" /> is <see langword="null" />.</exception> | ||
<exception cref="T:System.NotSupportedException">The HTTP version is 2.0 or higher or the version policy is set to <see cref="F:System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher" />. | ||
|
||
-or- | ||
|
||
The custom class derived from <see cref="T:System.Net.Http.HttpContent" /> does not override the <see cref="M:System.Net.Http.HttpContent.SerializeToStream(System.IO.Stream,System.Net.TransportContext,System.Threading.CancellationToken)" /> method. | ||
|
||
-or- | ||
|
||
The custom <see cref="T:System.Net.Http.HttpMessageHandler" /> does not override the <see cref="M:System.Net.Http.HttpMessageHandler.Send(System.Net.Http.HttpRequestMessage,System.Threading.CancellationToken)" /> method.</exception> | ||
<exception cref="T:System.InvalidOperationException">The request message was already sent by the <see cref="T:System.Net.Http.HttpClient" /> instance.</exception> | ||
<exception cref="T:System.Net.Http.HttpRequestException">The request failed due to an underlying issue such as network connectivity, DNS failure, or server certificate validation.</exception> | ||
<exception cref="T:System.Threading.Tasks.TaskCanceledException">If the <see cref="T:System.Threading.Tasks.TaskCanceledException" /> exception nests the <see cref="T:System.TimeoutException" />: | ||
The request failed due to timeout.</exception> | ||
</Docs> | ||
</Member> | ||
<Member MemberName="Send"> | ||
|
@@ -2745,11 +2787,36 @@ The <paramref name="requestUri" /> is not an absolute URI. | |
<Parameter Name="cancellationToken" Type="System.Threading.CancellationToken" Index="1" FrameworkAlternate="net-5.0" /> | ||
</Parameters> | ||
<Docs> | ||
<param name="request">To be added.</param> | ||
<param name="cancellationToken">To be added.</param> | ||
<summary>To be added.</summary> | ||
<returns>To be added.</returns> | ||
<remarks>To be added.</remarks> | ||
<param name="request">The HTTP request message to send.</param> | ||
<param name="cancellationToken">The token to cancel the operation.</param> | ||
<summary>Sends an HTTP request with the specified request and cancellation token.</summary> | ||
<returns>The HTTP response message.</returns> | ||
<remarks> | ||
<format type="text/markdown"><![CDATA[ | ||
|
||
## Remarks | ||
This operation blocks until the entire response, including content, is read or `cancellationToken` cancels the operation. | ||
|
||
]]></format> | ||
</remarks> | ||
<exception cref="T:System.ArgumentNullException">The <paramref name="request" /> is <see langword="null" />.</exception> | ||
<exception cref="T:System.NotSupportedException">The HTTP version is 2.0 or higher or the version policy is set to <see cref="F:System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher" />. | ||
|
||
-or- | ||
|
||
The custom class derived from <see cref="T:System.Net.Http.HttpContent" /> does not override the <see cref="M:System.Net.Http.HttpContent.SerializeToStream(System.IO.Stream,System.Net.TransportContext,System.Threading.CancellationToken)" /> method. | ||
|
||
-or- | ||
|
||
The custom <see cref="T:System.Net.Http.HttpMessageHandler" /> does not override the <see cref="M:System.Net.Http.HttpMessageHandler.Send(System.Net.Http.HttpRequestMessage,System.Threading.CancellationToken)" /> method.</exception> | ||
<exception cref="T:System.InvalidOperationException">The request message was already sent by the <see cref="T:System.Net.Http.HttpClient" /> instance.</exception> | ||
<exception cref="T:System.Net.Http.HttpRequestException">The request failed due to an underlying issue such as network connectivity, DNS failure, or server certificate validation.</exception> | ||
<exception cref="T:System.Threading.Tasks.TaskCanceledException">The request was canceled. | ||
|
||
-or- | ||
|
||
If the <see cref="T:System.Threading.Tasks.TaskCanceledException" /> exception nests the <see cref="T:System.TimeoutException" />: | ||
The request failed due to timeout.</exception> | ||
</Docs> | ||
</Member> | ||
<Member MemberName="Send"> | ||
|
@@ -2776,12 +2843,37 @@ The <paramref name="requestUri" /> is not an absolute URI. | |
<Parameter Name="cancellationToken" Type="System.Threading.CancellationToken" Index="2" FrameworkAlternate="net-5.0" /> | ||
</Parameters> | ||
<Docs> | ||
<param name="request">To be added.</param> | ||
<param name="completionOption">To be added.</param> | ||
<param name="cancellationToken">To be added.</param> | ||
<summary>To be added.</summary> | ||
<returns>To be added.</returns> | ||
<remarks>To be added.</remarks> | ||
<param name="request">The HTTP request message to send.</param> | ||
<param name="completionOption">One of the enumeration values that specifies when the operation should complete (as soon as a response is available or after reading the response content).</param> | ||
<param name="cancellationToken">The token to cancel the operation.</param> | ||
<summary>Sends an HTTP request with the specified request, completion option and cancellation token.</summary> | ||
<returns>The HTTP response message.</returns> | ||
<remarks> | ||
<format type="text/markdown"><![CDATA[ | ||
|
||
## Remarks | ||
This operation blocks until the entire response, including content, is read or `cancellationToken` cancels the operation. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The same as above, depends on the |
||
|
||
]]></format> | ||
</remarks> | ||
<exception cref="T:System.ArgumentNullException">The <paramref name="request" /> is <see langword="null" />.</exception> | ||
<exception cref="T:System.NotSupportedException">The HTTP version is 2.0 or higher or the version policy is set to <see cref="F:System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher" />. | ||
|
||
-or- | ||
|
||
The custom class derived from <see cref="T:System.Net.Http.HttpContent" /> does not override the <see cref="M:System.Net.Http.HttpContent.SerializeToStream(System.IO.Stream,System.Net.TransportContext,System.Threading.CancellationToken)" /> method. | ||
|
||
-or- | ||
|
||
The custom <see cref="T:System.Net.Http.HttpMessageHandler" /> does not override the <see cref="M:System.Net.Http.HttpMessageHandler.Send(System.Net.Http.HttpRequestMessage,System.Threading.CancellationToken)" /> method.</exception> | ||
<exception cref="T:System.InvalidOperationException">The request message was already sent by the <see cref="T:System.Net.Http.HttpClient" /> instance.</exception> | ||
<exception cref="T:System.Net.Http.HttpRequestException">The request failed due to an underlying issue such as network connectivity, DNS failure, or server certificate validation.</exception> | ||
<exception cref="T:System.Threading.Tasks.TaskCanceledException">The request was canceled. | ||
|
||
-or- | ||
|
||
If the <see cref="T:System.Threading.Tasks.TaskCanceledException" /> exception nests the <see cref="T:System.TimeoutException" />: | ||
The request failed due to timeout.</exception> | ||
</Docs> | ||
</Member> | ||
<MemberGroup MemberName="SendAsync"> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,11 +88,19 @@ | |
<Parameter Name="cancellationToken" Type="System.Threading.CancellationToken" Index="2" FrameworkAlternate="net-5.0" /> | ||
</Parameters> | ||
<Docs> | ||
<param name="stream">To be added.</param> | ||
<param name="context">To be added.</param> | ||
<param name="cancellationToken">To be added.</param> | ||
<summary>To be added.</summary> | ||
<remarks>To be added.</remarks> | ||
<param name="stream">The target stream.</param> | ||
<param name="context">Information about the transport (for example, the channel binding token). This parameter may be <see langword="null" />.</param> | ||
<param name="cancellationToken">The cancellation token to cancel the operation.</param> | ||
<summary>Serializes the HTTP content into a stream of bytes and copies it to <paramref name="stream" />.</summary> | ||
<remarks> | ||
<format type="text/markdown"><![CDATA[ | ||
|
||
## Remarks | ||
This operation blocks until all of the content is written to the stream object. | ||
|
||
]]></format> | ||
</remarks> | ||
<exception cref="T:System.ArgumentNullException">The <paramref name="stream" /> was <see langword="null" />.</exception> | ||
</Docs> | ||
</Member> | ||
<MemberGroup MemberName="CopyToAsync"> | ||
|
@@ -737,9 +745,16 @@ | |
</ReturnValue> | ||
<Parameters /> | ||
<Docs> | ||
<summary>To be added.</summary> | ||
<returns>To be added.</returns> | ||
<remarks>To be added.</remarks> | ||
<summary>Serializes the HTTP content and returns a stream that represents the content.</summary> | ||
<returns>The stream that represents the HTTP content.</returns> | ||
<remarks> | ||
<format type="text/markdown"><![CDATA[ | ||
|
||
## Remarks | ||
This operation blocks until all of the stream that represents content has been read. | ||
|
||
]]></format> | ||
</remarks> | ||
</Docs> | ||
</Member> | ||
<Member MemberName="ReadAsStream"> | ||
|
@@ -764,10 +779,17 @@ | |
<Parameter Name="cancellationToken" Type="System.Threading.CancellationToken" Index="0" FrameworkAlternate="net-5.0" /> | ||
</Parameters> | ||
<Docs> | ||
<param name="cancellationToken">To be added.</param> | ||
<summary>To be added.</summary> | ||
<returns>To be added.</returns> | ||
<remarks>To be added.</remarks> | ||
<param name="cancellationToken">The cancellation token to cancel the operation.</param> | ||
<summary>Serializes the HTTP content and returns a stream that represents the content.</summary> | ||
<returns>The stream that represents the HTTP content.</returns> | ||
<remarks> | ||
<format type="text/markdown"><![CDATA[ | ||
|
||
## Remarks | ||
This operation blocks until all of the stream that represents content has been read. | ||
EED3 |
|
|
]]></format> | ||
</remarks> | ||
</Docs> | ||
</Member> | ||
<Member MemberName="ReadAsStreamAsync"> | ||
|
@@ -964,11 +986,19 @@ | |
<Parameter Name="cancellationToken" Type="System.Threading.CancellationToken" Index="2" FrameworkAlternate="net-5.0" /> | ||
</Parameters> | ||
<Docs> | ||
<param name="stream">To be added.</param> | ||
<param name="context">To be added.</param> | ||
<param name="cancellationToken">To be added.</param> | ||
<summary>To be added.</summary> | ||
<remarks>To be added.</remarks> | ||
<param name="stream">The target stream.</param> | ||
<param name="context">Information about the transport (for example, the channel binding token). This parameter may be <see langword="null" />.</param> | ||
<param name="cancellationToken">The cancellation token to cancel the operation.</param> | ||
<summary>When overridden in a derived class, serializes the HTTP content to a stream. Otherwise, throws a <see cref="T:System.NotImplementedException" />.</summary> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Throws |
||
<remarks> | ||
<format type="text/markdown"><![CDATA[ | ||
|
||
## Remarks | ||
This operation blocks until all of the content has been serialized to the stream object. | ||
|
||
]]></format> | ||
</remarks> | ||
<exception cref="T:System.NotImplementedException">The method is not overridden in the derived class.</exception> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Throws |
||
</Docs> | ||
</Member> | ||
<Member MemberName="SerializeToStreamAsync"> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not true, handlers do not buffer response content.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@carlossanlop some of your team mentioned that we don't explicitly note the method is synchronous. What about remove sentence like "This operation blocks until the entire response, including content, is read." from all remarks?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed via chat, you can remove the sentence.