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

API Browser

Class

HttpStreamContent

class HttpStreamContent

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

Inheritance: Object → HttpContent → HttpStreamContent

One-shot HTTP content backed by an input stream.

Remarks

Creation transfers ownership only on success when leaveOpen is false. Dispose content if it is never sent; CopyTo never closes the stream.

Properties

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

Methods

10 items
CopyTo(destination: OutputStream, cancellationToken?: CancellationToken) -> Task<Result<void, HttpError>> Copies buffered or streaming content with bounded staging and backpressure. Inherited from HttpContent.CopyTo
Static member: Create(stream: InputStream, length: int, leaveOpen: bool, contentType: MediaType) -> Result<HttpStreamContent, HttpError> Creates a known-length stream with a validated media type.
Static member: Create(stream: InputStream, length: int, leaveOpen: bool) -> Result<HttpStreamContent, HttpError> Creates known-length streaming content without reading its source.
Dispose() -> () Releases owned stream content; borrowed sources remain open. Idempotent. Inherited from HttpContent.Dispose · 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. Inherited from HttpContent.GetContentType
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. Inherited from HttpContent.TryGetStream