Share via


ODataUtils.SetHeadersForPayload Method

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 Function SetHeadersForPayload ( _
    messageWriter As ODataMessageWriter, _
    payloadKind As ODataPayloadKind _
) As ODataFormat
'Usage
Dim messageWriter As ODataMessageWriter 
Dim payloadKind As ODataPayloadKind 
Dim returnValue As ODataFormat 

returnValue = ODataUtils.SetHeadersForPayload(messageWriter, _
    payloadKind)
public static ODataFormat SetHeadersForPayload(
    ODataMessageWriter messageWriter,
    ODataPayloadKind payloadKind
)
public:
static ODataFormat^ SetHeadersForPayload(
    ODataMessageWriter^ messageWriter, 
    ODataPayloadKind payloadKind
)
static member SetHeadersForPayload : 
        messageWriter:ODataMessageWriter * 
        payloadKind:ODataPayloadKind -> ODataFormat
public static function SetHeadersForPayload(
    messageWriter : ODataMessageWriter, 
    payloadKind : ODataPayloadKind
) : ODataFormat

Parameters

Return Value

Type: Microsoft.Data.OData.ODataFormat
The content-type and data service version headers on the message used by the message writer.

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

Microsoft.Data.OData Namespace