Common HTTP request and response headers used in Azure Cognitive Search
The Azure Cognitive Search REST APIs support a set of common HTTP request/response headers, summarized here for reference:
The requested content type for the response. Default is application/json;odata.metadata=minimal. Other allowable values are application/json, application/json;odata.metadata=full, application/json;odata.metadata=none, and text/plain (for $count only).
The OAuth 2.0 access token for the request. Requires configuration to your search service for role-based access. This request header is for client apps that use Azure Active Directory authentication and Azure role assignments. Your client code must provide the token. You can use this request header with any supported REST API version as long as the search service is configured for data plane authentication.
Content type of request body (PUT/POST). Default is application/json.
Optional caller-specified request ID, in the form of a GUID with no decoration such as curly braces (for example, client-request-id: 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0). A caller-defined value that identifies the given request. If specified, this will be included in response information as a way to map the request.
Specifies the maximum version of the OData protocol supported by the client. Default is "4.0"
"return=representation" or "return=minimal"
Used to control the response payload from PUT and POST /indexes requests. Default is "return=representation" when creating a new index via POST or PUT, and "return=minimal" for updating an existing index via PUT..
True or False
If specified when client-request-id is specified, instructs the server to include the client-request-id header in the response. Default is False.
ETag or *
Used to change a resource only if the current version matches the specified ETag. Use this header with POST, PUT, or DELETE methods on resources (such as indexers, indexes, and data sources, but not documents) to enable optimistic concurrency control.
ETag or *
Used to change a resource only if the current version does not match the specified ETag. Use this header with POST, PUT, or DELETE methods on resources (such as indexers, indexes, and data sources, but not documents) to enable optimistic concurrency control.
An identifier specified by the caller in the original request, if present.
The content type of the response body.
The URL of the newly created index definition for POST and PUT /indexes requests.
OData protocol version of the response.
A unique identifier for the current operation. Equal to client-request-id if specified; otherwise the value is generated on the server.
Time, in milliseconds, that the service spent processing the request. This only includes the time spent on processing the request, and does not include network transfer time.
An opaque string representing the current version of a resource (returned for indexers, indexes, and data sources, but not documents). Use this string in the If-Match or If-None-Match header for optimistic concurrency control.