Partager via


HttpContent Class

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

Inheritance Hierarchy

System.Object
  System.Net.Http.HttpContent
    System.Net.Http.ByteArrayContent
    System.Net.Http.MultipartContent
    System.Net.Http.StreamContent

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

Syntax

'Declaration
Public MustInherit Class HttpContent _
    Implements IDisposable
'Usage
Dim instance As HttpContent
public abstract class HttpContent : IDisposable
public ref class HttpContent abstract : IDisposable
[<AbstractClassAttribute>]
type HttpContent =  
    class 
        interface IDisposable 
    end
public abstract class HttpContent implements IDisposable

The HttpContent type exposes the following members.

Constructors

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

Top

Properties

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

Top

Methods

  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.

Top

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

Reference

System.Net.Http Namespace