Skip to content

Scope of disposal and cancelation #3523

Closed
@breyed

Description

@breyed

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions