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.

Namespace:  Microsoft.Data.OData
Assembly:  Microsoft.Data.OData (in Microsoft.Data.OData.dll)

Syntax

'Declaration
Public Sub SetContentType ( _
    acceptableMediaTypes As String, _
    acceptableCharSets As String _
)
'Usage
Dim instance As ODataMessageWriterSettings 
Dim acceptableMediaTypes As String 
Dim acceptableCharSets As String

instance.SetContentType(acceptableMediaTypes, _
    acceptableCharSets)
public void SetContentType(
    string acceptableMediaTypes,
    string acceptableCharSets
)
public:
void SetContentType(
    String^ acceptableMediaTypes, 
    String^ acceptableCharSets
)
member SetContentType : 
        acceptableMediaTypes:string * 
        acceptableCharSets:string -> unit
public function SetContentType(
    acceptableMediaTypes : String, 
    acceptableCharSets : String
)

Parameters

  • acceptableMediaTypes
    Type: System.String
    The 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.String
    The 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.

See Also

Reference

ODataMessageWriterSettings Class

SetContentType Overload

Microsoft.Data.OData Namespace