ODataUtils.SetHeadersForPayload(ODataMessageWriter, ODataPayloadKind) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Sets the content-type and OData-Version headers on the message used by the message writer.
public static Microsoft.OData.ODataFormat SetHeadersForPayload (Microsoft.OData.ODataMessageWriter messageWriter, Microsoft.OData.ODataPayloadKind payloadKind);
static member SetHeadersForPayload : Microsoft.OData.ODataMessageWriter * Microsoft.OData.ODataPayloadKind -> Microsoft.OData.ODataFormat
Public Function SetHeadersForPayload (messageWriter As ODataMessageWriter, payloadKind As ODataPayloadKind) As ODataFormat
Parameters
- messageWriter
- ODataMessageWriter
The message writer to set the headers for.
- payloadKind
- ODataPayloadKind
The kind of payload to be written with the message writer.
Returns
The content-type and OData-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.