ODataVersion class

Represents supported version of the "OData-Version" header, which is part of the Open Data Protocol standard.

Properties

v3

Represents version 3.0 for the "OData-Version" header

v4

Represents version 4.0 for the "OData-Version" header

Methods

toString()

Returns the "OData-Version" value, for example "4.0".

tryParseFromHeaders(headers)

Attempt to parse the "OData-Version" header.

Property Details

v3

Represents version 3.0 for the "OData-Version" header

static v3: ODataVersion;

Property Value

@microsoft/sp-http!default:class

v4

Represents version 4.0 for the "OData-Version" header

static v4: ODataVersion;

Property Value

@microsoft/sp-http!default:class

Method Details

toString()

Returns the "OData-Version" value, for example "4.0".

toString(): string;

Returns

string

tryParseFromHeaders(headers)

Attempt to parse the "OData-Version" header.

static tryParseFromHeaders(headers: Headers): ODataVersion | undefined;

Parameters

headers

Headers

Returns

@microsoft/sp-http!default:class | undefined

Remarks

If the "OData-Version" header is present, this returns the corresponding ODataVersion constant. An error is thrown if the version number is not supported. If the header is missing, then undefined is returned.