HttpRequestMessageExtensions.CreateContent Method (HttpRequestMessage, Type, Object)
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Creates a new ObjectContent instance associated with the given HttpRequestMessage.
Namespace: System.Net.Http
Assembly: System.Net.Http.Formatting (in System.Net.Http.Formatting.dll)
Syntax
'Declaration
<ExtensionAttribute> _
Public Shared Function CreateContent ( _
request As HttpRequestMessage, _
type As Type, _
value As Object _
) As ObjectContent
public static ObjectContent CreateContent(
this HttpRequestMessage request,
Type type,
Object value
)
[ExtensionAttribute]
public:
static ObjectContent^ CreateContent(
HttpRequestMessage^ request,
Type^ type,
Object^ value
)
static member CreateContent :
request:HttpRequestMessage *
type:Type *
value:Object -> ObjectContent
public static function CreateContent(
request : HttpRequestMessage,
type : Type,
value : Object
) : ObjectContent
Parameters
- request
Type: System.Net.Http.HttpRequestMessage
The existing HttpRequestMessage
- type
Type: System.Type
The type of the value.
- value
Type: System.Object
The value for the new ObjectContent
Return Value
Type: System.Net.Http.ObjectContent
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type HttpRequestMessage. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.