Edit

Share via


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

v4

Represents version 4.0 for the "OData-Version" header

static v4: ODataVersion;

Property Value

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

ODataVersion | 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.