ObjectContent<T> Constructor
Namespace: System.Net.Http
Assembly: System.Net.Http.Formatting (in System.Net.Http.Formatting.dll)
Overload List
Name | Description | |
---|---|---|
ObjectContent<T>(T, MediaTypeFormatter) | Initializes a new instance of the ObjectContent<T> class. |
|
ObjectContent<T>(T, MediaTypeFormatter, MediaTypeHeaderValue) | Initializes a new instance of the <see cref="T:System.Net.Http.ObjectContent`1" /> class. |
|
ObjectContent<T>(T, MediaTypeFormatter, String) | Initializes a new instance of the ObjectContent<T> class. |
See Also
ObjectContent<T> Class
System.Net.Http Namespace
Return to top
ObjectContent<T> Constructor (T, MediaTypeFormatter)
Initializes a new instance of the ObjectContent<T> class.
Syntax
public ObjectContent(
T value,
MediaTypeFormatter formatter
)
public:
ObjectContent(
T value,
MediaTypeFormatter^ formatter
)
new :
value:'T *
formatter:MediaTypeFormatter -> ObjectContent
Public Sub New (
value As T,
formatter As MediaTypeFormatter
)
Parameters
value
Type: TThe value of the object this instance will contain.
formatter
Type: System.Net.Http.Formatting.MediaTypeFormatterThe formatter to use when serializing the value.
Return to top
ObjectContent<T> Constructor (T, MediaTypeFormatter, MediaTypeHeaderValue)
Initializes a new instance of the <see cref="T:System.Net.Http.ObjectContent`1" /> class.
Syntax
public ObjectContent(
T value,
MediaTypeFormatter formatter,
MediaTypeHeaderValue mediaType
)
public:
ObjectContent(
T value,
MediaTypeFormatter^ formatter,
MediaTypeHeaderValue^ mediaType
)
new :
value:'T *
formatter:MediaTypeFormatter *
mediaType:MediaTypeHeaderValue -> ObjectContent
Public Sub New (
value As T,
formatter As MediaTypeFormatter,
mediaType As MediaTypeHeaderValue
)
Parameters
value
Type: TThe value of the object this instance will contain.
formatter
Type: System.Net.Http.Formatting.MediaTypeFormatterThe formatter to use when serializing the value.
mediaType
Type: System.Net.Http.Headers.MediaTypeHeaderValueThe authoritative value of the Content-Type header. Can be null, in which case the default content type of the formatter will be used.
Return to top
ObjectContent<T> Constructor (T, MediaTypeFormatter, String)
Initializes a new instance of the ObjectContent<T> class.
Syntax
public ObjectContent(
T value,
MediaTypeFormatter formatter,
string mediaType
)
public:
ObjectContent(
T value,
MediaTypeFormatter^ formatter,
String^ mediaType
)
new :
value:'T *
formatter:MediaTypeFormatter *
mediaType:string -> ObjectContent
Public Sub New (
value As T,
formatter As MediaTypeFormatter,
mediaType As String
)
Parameters
value
Type: TThe value of the object this instance will contain.
formatter
Type: System.Net.Http.Formatting.MediaTypeFormatterThe formatter to use when serializing the value.
mediaType
Type: System.StringThe authoritative value of the Content-Type header.
Return to top