Share via

HttpContent Class

A base class representing an HTTP entity body and content headers.

Inheritance Hierarchy


Namespace:  System.Net.Http
Assembly:  System.Net.Http (in System.Net.Http.dll)


Public MustInherit Class HttpContent _
    Implements IDisposable
Dim instance As HttpContent
public abstract class HttpContent : IDisposable
public ref class HttpContent abstract : IDisposable
type HttpContent =  
        interface IDisposable 
public abstract class HttpContent implements IDisposable

The HttpContent type exposes the following members.


  Name Description
Protected method HttpContent Initializes a new instance of the HttpContent class.



  Name Description
Public property Headers Gets the HTTP content headers as defined in RFC 2616.



  Name Description
Public method CopyToAsync(Stream) Write the HTTP content to a stream as an asynchronous operation.
Public method CopyToAsync(Stream, TransportContext) Write the HTTP content to a stream as an asynchronous operation.
Protected method CreateContentReadStreamAsync
Public method Dispose() Releases the unmanaged resources and disposes of the managed resources used by the HttpContent.
Protected method Dispose(Boolean) Releases the unmanaged resources used by the HttpContent and optionally disposes of the managed resources.
Public method Equals (Inherited from Object.)
Protected method Finalize (Inherited from Object.)
Public method GetHashCode (Inherited from Object.)
Public method GetType (Inherited from Object.)
Public method LoadIntoBufferAsync() Serialize the HTTP content to a memory buffer as an asynchronous operation.
Public method LoadIntoBufferAsync(Int64)
Protected method MemberwiseClone (Inherited from Object.)
Public method ReadAsByteArrayAsync
Public method ReadAsStreamAsync
Public method ReadAsStringAsync
Protected method SerializeToStreamAsync Serialize the HTTP content to a stream as an asynchronous operation.
Public method ToString (Inherited from Object.)
Protected method TryComputeLength Determines whether the HTTP content has a valid length in bytes.


Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also


System.Net.Http Namespace