Contains a value as well as an associated MediaTypeFormatter that will be used to serialize the value when writing this content.
Inheritance Hierarchy
System.Object
  HttpContent
    System.Net.Http.ObjectContent
      System.Net.Http.ObjectContent<T>
Namespace:  System.Net.Http
Assembly:  System.Net.Http.Formatting (in System.Net.Http.Formatting.dll)
Syntax
'Declaration
Public Class ObjectContent _
    Inherits HttpContent
'Usage
Dim instance As ObjectContent
public class ObjectContent : HttpContent
public ref class ObjectContent : public HttpContent
type ObjectContent =  
    class
        inherit HttpContent
    end
public class ObjectContent extends HttpContent
The ObjectContent type exposes the following members.
Constructors
| Name | Description | |
|---|---|---|
| .jpeg) | ObjectContent(Type, Object, MediaTypeFormatter) | Initializes a new instance of the ObjectContent class. | 
| .jpeg) | ObjectContent(Type, Object, MediaTypeFormatter, MediaTypeHeaderValue) | Initializes a new instance of the ObjectContent class. | 
| .jpeg) | ObjectContent(Type, Object, MediaTypeFormatter, String) | Initializes a new instance of the ObjectContent class. | 
Top
Properties
| Name | Description | |
|---|---|---|
| .jpeg) | Formatter | Gets the media-type formatter associated with this content instance. | 
| .jpeg) | Headers | (Inherited from HttpContent.) | 
| .jpeg) | ObjectType | Gets the type of object managed by this ObjectContent instance. | 
| .jpeg) | Value | Gets or sets the value of the content. | 
Top
Methods
| Name | Description | |
|---|---|---|
| .jpeg) | CopyToAsync(Stream) | (Inherited from HttpContent.) | 
| .jpeg) | CopyToAsync(Stream, TransportContext) | (Inherited from HttpContent.) | 
| .jpeg) | CreateContentReadStreamAsync | (Inherited from HttpContent.) | 
| .jpeg) | Dispose() | (Inherited from HttpContent.) | 
| .jpeg) | Dispose(Boolean) | (Inherited from HttpContent.) | 
| .jpeg) | Equals | (Inherited from Object.) | 
| .jpeg) | Finalize | (Inherited from Object.) | 
| .jpeg) | GetHashCode | (Inherited from Object.) | 
| .jpeg) | GetType | (Inherited from Object.) | 
| .jpeg) | LoadIntoBufferAsync() | (Inherited from HttpContent.) | 
| .jpeg) | LoadIntoBufferAsync(Int64) | (Inherited from HttpContent.) | 
| .jpeg) | MemberwiseClone | (Inherited from Object.) | 
| .jpeg) | ReadAsByteArrayAsync | (Inherited from HttpContent.) | 
| .jpeg) | ReadAsStreamAsync | (Inherited from HttpContent.) | 
| .jpeg) | ReadAsStringAsync | (Inherited from HttpContent.) | 
| .jpeg) | SerializeToStreamAsync | Asynchronously serializes the object's content to the given stream. (Overrides HttpContentSerializeToStreamAsync(Stream, TransportContext).) | 
| .jpeg) | ToString | (Inherited from Object.) | 
| .jpeg) | TryComputeLength | Computes the length of the stream if possible. (Overrides HttpContentTryComputeLength(Int64%).) | 
Top
Extension Methods
| Name | Description | |
|---|---|---|
| .gif) | IsFormData | Determines whether the specified content is HTML form URL-encoded data. (Defined by HttpContentFormDataExtensions.) | 
| .gif) | IsHttpRequestMessageContent | Determines whether the specified content is HTTP request message content. (Defined by HttpContentMessageExtensions.) | 
| .gif) | IsHttpResponseMessageContent | Determines whether the specified content is HTTP response message content. (Defined by HttpContentMessageExtensions.) | 
| .gif) | IsMimeMultipartContent() | Overloaded. Determines whether the specified content is MIME multipart content. (Defined by HttpContentMultipartExtensions.) | 
| .gif) | IsMimeMultipartContent(String) | Overloaded. Determines whether the specified content is MIME multipart content with the specified subtype. (Defined by HttpContentMultipartExtensions.) | 
| .gif) | ReadAsAsync(Type) | Overloaded. Returns a Task that will yield an object of the specified type from the content instance. (Defined by HttpContentExtensions.) | 
| .gif) | ReadAsAsync(Type, IEnumerable<MediaTypeFormatter>) | Overloaded. Returns a Task that will yield an object of the specified type from the content instance using one of the provided formatters to deserialize the content. (Defined by HttpContentExtensions.) | 
| .gif) | ReadAsAsync(Type, IEnumerable<MediaTypeFormatter>, IFormatterLogger) | Overloaded. Returns a Task that will yield an object of the specified type from the content instance using one of the provided formatters to deserialize the content. (Defined by HttpContentExtensions.) | 
| .gif) | ReadAsAsync<T>() | Overloaded. Returns a Task that will yield an object of the specified type <typeparamref name="T" /> from the content instance. (Defined by HttpContentExtensions.) | 
| .gif) | ReadAsAsync<T>(IEnumerable<MediaTypeFormatter>) | Overloaded. Returns a Task that will yield an object of the specified type <typeparamref name="T" /> from the content instance. (Defined by HttpContentExtensions.) | 
| .gif) | ReadAsAsync<T>(IEnumerable<MediaTypeFormatter>, IFormatterLogger) | Overloaded. Returns a Task that will yield an object of the specified type <typeparamref name="T" /> from the content instance. (Defined by HttpContentExtensions.) | 
| .gif) | ReadAsFormDataAsync | Asynchronously reads HTML form URL-encoded from an HttpContent instance and stores the results in a NameValueCollection object. (Defined by HttpContentFormDataExtensions.) | 
| .gif) | ReadAsHttpRequestMessageAsync() | Overloaded. Reads the HttpContent as an HttpRequestMessage. (Defined by HttpContentMessageExtensions.) | 
| .gif) | ReadAsHttpRequestMessageAsync(String) | Overloaded. Reads the HttpContent as an HttpRequestMessage. (Defined by HttpContentMessageExtensions.) | 
| .gif) | ReadAsHttpRequestMessageAsync(String, Int32) | Overloaded. Reads the HttpContent as an HttpRequestMessage. (Defined by HttpContentMessageExtensions.) | 
| .gif) | ReadAsHttpRequestMessageAsync(String, Int32, Int32) | Overloaded. Reads the HttpContent as an HttpRequestMessage. (Defined by HttpContentMessageExtensions.) | 
| .gif) | ReadAsHttpResponseMessageAsync() | Overloaded. Reads the HttpContent as an HttpResponseMessage. (Defined by HttpContentMessageExtensions.) | 
| .gif) | ReadAsHttpResponseMessageAsync(Int32) | Overloaded. Reads the HttpContent as an HttpResponseMessage. (Defined by HttpContentMessageExtensions.) | 
| .gif) | ReadAsHttpResponseMessageAsync(Int32, Int32) | Overloaded. Reads the HttpContent as an HttpResponseMessage. (Defined by HttpContentMessageExtensions.) | 
| .gif) | ReadAsMultipartAsync() | Overloaded. Reads all body parts within a MIME multipart message and produces a set of HttpContent instances as a result. (Defined by HttpContentMultipartExtensions.) | 
| .gif) | ReadAsMultipartAsync<T>(T) | Overloaded. Reads all body parts within a MIME multipart message and produces a set of HttpContent instances as a result using the streamProvider instance to determine where the contents of each body part is written. (Defined by HttpContentMultipartExtensions.) | 
| .gif) | ReadAsMultipartAsync<T>(T, Int32) | Overloaded. Reads all body parts within a MIME multipart message and produces a set of HttpContent instances as a result using the streamProvider instance to determine where the contents of each body part is written and bufferSize as read buffer size. (Defined by HttpContentMultipartExtensions.) | 
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.