ODataMessageWriterSettings.SetContentType Method
Sets the format to be used when writing the payload. This will automatically set a compatible content type header.
Namespace: Microsoft.OData.Core
Assembly: Microsoft.OData.Core (in Microsoft.OData.Core.dll)
Overload List
Name | Description | |
---|---|---|
SetContentType(ODataFormat) | Sets the format to be used when writing the payload. This will automatically set a compatible content type header. |
|
SetContentType(String, String) | Sets the acceptable media types and character sets from which the content type will be computed when writing the payload. |
See Also
ODataMessageWriterSettings Class
Microsoft.OData.Core Namespace
Return to top
ODataMessageWriterSettings.SetContentType Method (ODataFormat)
Sets the format to be used when writing the payload. This will automatically set a compatible content type header.
Syntax
public void SetContentType(
ODataFormat payloadFormat
)
public:
void SetContentType(
ODataFormat^ payloadFormat
)
member SetContentType :
payloadFormat:ODataFormat -> unit
Public Sub SetContentType (
payloadFormat As ODataFormat
)
Parameters
payloadFormat
Type: Microsoft.OData.Core.ODataFormatThe format to use for writing the payload.
Remarks
Calling this method replaces any previously set content-type settings.
Return to top
ODataMessageWriterSettings.SetContentType Method (String, String)
Sets the acceptable media types and character sets from which the content type will be computed when writing the payload.
Syntax
public void SetContentType(
string acceptableMediaTypes,
string acceptableCharSets
)
public:
void SetContentType(
String^ acceptableMediaTypes,
String^ acceptableCharSets
)
member SetContentType :
acceptableMediaTypes:string *
acceptableCharSets:string -> unit
Public Sub SetContentType (
acceptableMediaTypes As String,
acceptableCharSets As String
)
Parameters
acceptableMediaTypes
Type: System.StringThe acceptable media types used to determine the content type of the message. This is a comma separated list of content types as specified in RFC 2616, Section 14.1.
acceptableCharSets
Type: System.StringThe acceptable charsets to use to determine the encoding of the message. This is a comma separated list of charsets as specified in RFC 2616, Section 14.2
Remarks
Calling this method replaces any previously set content-type settings.
Return to top