ObjectContent<T> Constructor (T, MediaTypeFormatter, MediaTypeHeaderValue)

Initializes a new instance of the <see cref="T:System.Net.Http.ObjectContent`1" /> class.

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

public ObjectContent(
	T value,
	MediaTypeFormatter formatter,
	MediaTypeHeaderValue mediaType
)

Parameters

value
Type: T
The value of the object this instance will contain.
formatter
Type: System.Net.Http.Formatting.MediaTypeFormatter
The formatter to use when serializing the value.
mediaType
Type: MediaTypeHeaderValue
The authoritative value of the Content-Type header. Can be null, in which case the default content type of the formatter will be used.
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft