3.2.5.4.3 Executing a Received RetrieveCount Request

Applies to the OData 2.0 and OData 3.0 protocols

In addition to the directives specified in the sections Common Rules: Receiving Responses from Data Service Requests (section 3.1.5.1) and Executing a Received Retrieve Request (section 3.2.5.4), the directives defined in this section apply when receiving a RetrieveCount request; see RetrieveCount Request (section 2.2.7.2.10).

When the InlineCount system query option is used, the resource path section of the URI MUST identify a collection of entities. If the Resource Path section of the URI does not identify a collection of entities or a single EntityType instance, then the data service MUST return a 4xx error response code. As well, the data service MAY support the InlineCount system query option on a URI that identifies a single EntityType instance.

The presence of the $top, $skip, $orderby, $format, or $expand query option in the data service URI MUST NOT change the count value N.

The InlineCount system query option MUST be used with an HTTP GET request type. If an InlineCount request is made by using an HTTP verb other than GET, the data service MUST return a 4xx error response code.

RetrieveCount requests are supported in the OData 2.0 and OData 3.0 protocols. A response to a RetrieveCount request MUST also include a DataServiceVersion (section 2.2.5.3) response header to indicate which version of the OData protocol that the response is using.