The behavior of the HttpClient.PostAsync method is to dispose of the provided HttpContent object.
There are many ways to get around this behavior including constructing a new HttpContent
for each call made on the client or loading the content to a stream and changing the pointer.
I'm wondering why invoking this method automatically invokes the disposal of its IDisposable
parameters? As far as I'm aware this is not a common behavior in .NET
It's also worth noting that this behavior is observed in PUT
requests as well, which are idempotent, so the premise that this behavior is to prevent the information from being sent again doesn't seem correct.