Common HTTP request and response headers used in Azure Cognitive Search
Tiempo de lectura: 2 minutos
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.metata=full, application/json;odata.metadata=none, and text/plain (for $count only).
Set to your query or admin key, depending on the API.
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.