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)


Public Sub SetContentType ( _
    acceptableMediaTypes As String, _
    acceptableCharSets As String _
Dim instance As ODataMessageWriterSettings 
Dim acceptableMediaTypes As String 
Dim acceptableCharSets As String

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


  • 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


Calling this method replaces any previously set content-type settings.

See Also


ODataMessageWriterSettings Class

SetContentType Overload

Microsoft.Data.OData Namespace