3.1.5.1 Common Rules for Receiving Responses from Data Service Requests

This section defines a common set of rules to which a client MUST adhere when receiving a response to any data service request that is sent.

The client MUST verify that the response adheres to the syntax specified in the subsection of Request Types (section 2.2.7) that defines the response associated with the request type.

If the HTTP status code indicates that the request completed in error, the client MUST validate and interpret the response body (if one is present) by using the syntax rules in Error Response (section 2.2.8.1).

If the HTTP status code indicates that the request succeeded, the client MUST validate and interpret the response body (if one is present) by using the syntax rules defined in the appropriate subsection(s) of Common Payload Syntax (section 2.2.6).

If a Content-Type (section 2.2.5.2) header is present in the response and its value is not one of the valid values for an Accept (section 2.2.5.1) request header on the associated request type, then the client SHOULD report an error to the higher layer.

If a DataServiceVersion (section 2.2.5.3) header is included in the response, the client MUST validate that the version number in the header is lower than or equal to the highest version of this document that it understands. If it is lower than or equal to the highest version of this document that the client understands, the client continues to process the request. If the version number in the header is higher than the highest version of this document that the client can interpret, the client MUST report an error to the higher layer.

If no DataServiceVersion (section 2.2.5.3) header is present in the response, then the client SHOULD interpret the request by using the highest version number of this document that it understands. For additional details on the versioning scheme defined by this document, see Versioning and Capability Negotiation (section 1.7).

If the ETag (section 2.2.5.4) header is present in the response, the client SHOULD report the value of the header (which represents the concurrency token associated with the resource on which the request acted) to the higher layer such that the value can be used in a future request, or in an If-Match (section 2.2.5.5) or If-None-Match (section 2.2.5.6) request header.