ObjectContent Constructor (Type, Object, MediaTypeFormatter, String)
Initializes a new instance of the ObjectContent class.
Namespace: System.Net.Http
Assembly: System.Net.Http.Formatting (in System.Net.Http.Formatting.dll)
Syntax
'Declaration
Public Sub New ( _
type As Type, _
value As Object, _
formatter As MediaTypeFormatter, _
mediaType As String _
)
'Usage
Dim type As Type
Dim value As Object
Dim formatter As MediaTypeFormatter
Dim mediaType As String
Dim instance As New ObjectContent(type, value, _
formatter, mediaType)
public ObjectContent(
Type type,
Object value,
MediaTypeFormatter formatter,
string mediaType
)
public:
ObjectContent(
Type^ type,
Object^ value,
MediaTypeFormatter^ formatter,
String^ mediaType
)
new :
type:Type *
value:Object *
formatter:MediaTypeFormatter *
mediaType:string -> ObjectContent
public function ObjectContent(
type : Type,
value : Object,
formatter : MediaTypeFormatter,
mediaType : String
)
Parameters
type
Type: System.TypeThe type of object this instance will contain.
value
Type: System.ObjectThe 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.