Development · Native API migration preview · Coverage validation in progress Published release →

API Browser

Class

HttpContent

class HttpContent

Module: System.Web.Http
Assembly: System.Web.dll
Source file: HttpClient.rvn

Inheritance: Object → HttpContent
Implements: Disposable

Abstract HTTP body and content metadata with stream transfer and explicit ownership.

Remarks

Create HttpMemoryContent, HttpStreamContent or HttpStringContent. CopyTo supports backpressure; TryGetStream exposes streaming sources. Buffered storage belongs to the concrete type. Custom producers and unknown-length outgoing framing remain pending.

Derived types

Documented types in this API reference. Indirect relationships are marked.

Constructors

7 items
HttpContent() No summary available.
HttpContent(bytes: Sequence<byte>, contentType: string) Wraps bytes and an outbound Content-Type; socket validation occurs before I/O.
HttpContent(bytes: Sequence<byte>) No summary available.
HttpContent(contentType: MediaType) No summary available.
HttpContent(contentType: string) No summary available.

Properties

2 items
IsBuffered: bool True when content already has a complete byte sequence.
Length: int Declared byte count, or -1 for incoming chunked/close-delimited content.

Methods

8 items
CopyTo(destination: OutputStream, cancellationToken?: CancellationToken) -> Task<Result<void, HttpError>> Copies buffered or streaming content with bounded staging and backpressure.
Dispose() -> () Releases owned stream content; borrowed sources remain open. Idempotent. Implements Disposable.Dispose
Equals(other: object?) -> bool Tests reference identity by default; an ordinary class may override equality. Inherited from Object.Equals
GetContentType() -> Result<Optional<MediaType>, HttpError> Parses this producer's declared Content-Type without consuming its body.
GetHashCode() -> int Returns a stable identity hash by default; an ordinary class may override it consistently with equality. Inherited from Object.GetHashCode
GetType() -> TypeInfo Returns metadata for the concrete runtime type of this instance. Inherited from Object.GetType
ToString() -> string Returns the concrete runtime type name for supported references, or display text from a class or boxed-struct override. Inherited from Object.ToString
TryGetStream() -> Optional<InputStream> Returns the one-shot input stream, or None for buffered content. Does not read. The content owns the stream unless HttpStreamContent.Create was passed leaveOpen=true.