SetHeadersForPayload Method (ODataMessageWriter, ODataPayloadKind, String)

Sets the content-type and data service version headers on the message used by the message writer.

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

Syntax

'Declaration
Public Shared Sub SetHeadersForPayload ( _
    messageWriter As ODataMessageWriter, _
    payloadKind As ODataPayloadKind, _
    mimeType As String _
)
'Usage
Dim messageWriter As ODataMessageWriter
Dim payloadKind As ODataPayloadKind
Dim mimeType As String

ODataUtils.SetHeadersForPayload(messageWriter, _
    payloadKind, mimeType)
public static void SetHeadersForPayload(
    ODataMessageWriter messageWriter,
    ODataPayloadKind payloadKind,
    string mimeType
)
public:
static void SetHeadersForPayload(
    ODataMessageWriter^ messageWriter, 
    ODataPayloadKind payloadKind, 
    String^ mimeType
)
static member SetHeadersForPayload : 
        messageWriter:ODataMessageWriter * 
        payloadKind:ODataPayloadKind * 
        mimeType:string -> unit 
public static function SetHeadersForPayload(
    messageWriter : ODataMessageWriter, 
    payloadKind : ODataPayloadKind, 
    mimeType : String
)

Parameters

  • mimeType
    Type: System..::..String
    The MIME type to be used for writing the content of the message. Note that this is only supported for top-level raw values.

Remarks

This method can be called if it is important to set all the message headers before calling any of the write methods on the messageWriter. If it is sufficient to set the headers when the write methods on the messageWriter are called, you don't have to call this method and setting the headers will happen automatically.

See Also

Reference

ODataUtils Class

SetHeadersForPayload Overload

Microsoft.Data.OData Namespace