<PackageReference Include="Microsoft.Net.Http" Version="2.2.22" />

System.Net.Http.HttpContent

public abstract class HttpContent : IDisposable
A base class representing an HTTP entity body and content headers.
public HttpContentHeaders Headers { get; }

Gets the HTTP content headers as defined in RFC 2616.

protected HttpContent()

Initializes a new instance of the HttpContent class.

public Task CopyToAsync(Stream stream, TransportContext context)

Write the HTTP content to a stream as an asynchronous operation.

public Task CopyToAsync(Stream stream)

Write the HTTP content to a stream as an asynchronous operation.

protected virtual void Dispose(bool disposing)

Releases the unmanaged resources used by the HttpContent and optionally disposes of the managed resources.

public void Dispose()

Releases the unmanaged resources and disposes of the managed resources used by the HttpContent.

Serialize the HTTP content to a memory buffer as an asynchronous operation.

public Task LoadIntoBufferAsync(long maxBufferSize)

public Task<byte[]> ReadAsByteArrayAsync()

public Task<string> ReadAsStringAsync()

protected abstract Task SerializeToStreamAsync(Stream stream, TransportContext context)

Serialize the HTTP content to a stream as an asynchronous operation.