EmptyContent Class
- Namespace
- Kampute.HttpClient.Content
- Assembly
- Kampute.HttpClient.dll
Definition
Represents content with no body, whose length is zero.
public sealed class EmptyContent : HttpContent- Inheritance
- object
- HttpContent
- EmptyContent
Remarks
Methods
SerializeToStreamAsync(Stream, TransportContext)
Writes nothing to the stream.
protected override Task SerializeToStreamAsync(Stream stream, TransportContext context)Parameters
streamStream- The stream to write to.
contextTransportContext- The transport context.
Returns
- Task
- A task that represents the asynchronous operation.
TryComputeLength(out long)
Returns the length of the content, which is zero.
protected override bool TryComputeLength(out long length)Parameters
lengthlong- Always 0.
Returns
Extension Methods
| AsDeflate(this HttpContent, CompressionLevel) | Wraps the content in content that compresses it with Deflate as it is sent. |
| AsGzip(this HttpContent, CompressionLevel) | Wraps the content in content that compresses it with GZip as it is sent. |
| FindCharacterEncoding(this HttpContent) | Returns the character encoding named by the charset parameter of the Content-Type header. |
| IsReusable(this HttpContent) | Determines whether the content can be sent more than once, as a retry requires. |

Content-*headers, but no body.