Class EmptyContent
- Namespace
- Kampute.HttpClient.Content
- Assembly
- Kampute.HttpClient.dll
Represents an HTTP content with no data.
public sealed class EmptyContent : HttpContent, IDisposable
- Inheritance
-
EmptyContent
- Implements
- Inherited Members
- Extension Methods
Remarks
This class is used when an HTTP request or response needs to indicate a content body, but there should be no actual content sent or received. It effectively sets the content length to 0 and does not write anything to the output stream.
Methods
SerializeToStreamAsync(Stream, TransportContext)
protected override Task SerializeToStreamAsync(Stream stream, TransportContext context)
Parameters
stream
Streamcontext
TransportContext
Returns
TryComputeLength(out long)
protected override bool TryComputeLength(out long length)
Parameters
length
long