3.2.5.4 Executing a Received Retrieve Request
The directives defined in this section apply when executing a received request of any of the Retrieve request types defined in Retrieve Request Types (section 2.2.7.2).
If the request includes an If-None-Match (section 2.2.5.6), the header MUST be parsed and processed, as described in If-None-Match (section 2.2.5.6). If the value of the header is "*" and the target EntityType defines a concurrency token, then a 304 (Not Modified) response MUST be returned. When retrieving a Media Resource, the target EntityType in the prior sentence is the EntityType of the entity, which is the Media Link Entry for the Media Resource being retrieved.
If the request is a RetrievePrimitiveProperty (section 2.2.7.2.4), RetrieveComplexType (section 2.2.7.2.3), or RetrieveValue (section 2.2.7.2.5) request and the request URI identifies a dynamic property that does not currently exist (on the associated OpenEntityType), then the server MUST respond as if the property existed and its value is null.
If the request includes an InlineCount system query option (section 2.2.3.6.1.10), the response SHOULD include a DataServiceVersion (section 2.2.5.3) response header that indicates that the response is using either the OData 2.0 or OData 3.0 protocol.
In addition to validating the request headers, the server MUST validate that the HTTP request URI and payload adhere to the syntax for Retrieve Request Types (section 2.2.7.2). The server validates the request based on its knowledge of the Entity Data Model associated with the service. For example, the server validates each request URI path segment against the EntityTypes, EntitySets, and so on, in the associated data model to ensure that each identifies a valid construct defined in the data service's Abstract Data Model (section 2.2.1) and that the request URI as a whole identifies a valid resource.
If this validation fails, the server MUST respond with a valid HTTP [RFC2616] error status code, as specified in Common Response Codes (section 3.2.8), and an error message that is formatted according to Error Response (section 2.2.8.1).
If the validation succeeds, the server MUST obtain the requested resources and return a response (with a 2xx response code) following the rules for the retrieve request type, as specified in Retrieve Request Types (section 2.2.7.2).