Closed
Description
Does disposing a HttpClient
object dispose any HttpResponseMessage
objects (and their HttpContent
objects) that it has created? Does HttpClient.CancelPendingRequests
cancel HttpContent.ReadAsStringAsync
on objects it has created? Does a cancellation token passed to HttpClient.SendAsync
apply to HttpContent.ReadAsStringAsync
?
In general, the scoping rules regarding disposal and cancelation need to be better documented. It would appear that there is at least some interconnection; otherwise, one would expect the async methods in HttpContent
to take a cancellation token. But the docs don't say what the rules are.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: 7ef78901-be85-0439-819b-39a792a34672
- Version Independent ID: 5505e40d-6767-b131-4b42-0b92634b6fa4
- Content: HttpMessageInvoker.Dispose Method (System.Net.Http)
- Content Source: xml/System.Net.Http/HttpMessageInvoker.xml
- Product: .net
- GitHub Login: @dotnet-bot
- Microsoft Alias: dotnetcontent