Skip to content
ADP
API Design PrincipleBETA

[ADP-121] Common HTTP headers

reviewing phase 1

Directly link to headers ADP individually.

Guidance

Request Headers

HeaderTypeDescriptionRFC Source
AcceptStringThe media type acceptable for the response body. Required for requests that have a response with a body. Can be one of the media types listed above in conjunction with a profile parameter including the profile URI of a resource. For example: application/hal+json;profile="https://api.doc/profiles/checkout/delivery-methods+v1".RFC 9110, section 12.5.1
AuthorizationStringThe OAuth 2.0 bearer token to authorize the request for accessing the API. Required for all requests. For example: Bearer <Access token>.RFC 9110, section 11.6.2
Content-TypeStringThe media type of the request body. Required when a request body contains data. Can be one of the media types listed above in conjunction with a profile parameter including the profile URI of a resource. For example: application/hal+json;profile="https://api.otto.de/portal/profiles/checkout/delivery-methods+v1".RFC 9110, section 8.3
If-MatchStringOptional. Makes the request conditional and only performs successfully if the ETag of the target resource matches the ETag value provided in this header. For example: If-Match:"4711bfc13a4712".RFC 9110, section 13.1.1
If-None-MatchStringOptional. Makes the request conditional and only performs successfully if the ETag of the target resource does not match the ETag value provided in this header. For example: If-None-Match:"4711bfc13a4712".RFC 9110, section 13.1.2
X-Request-IDStringA unique identifier for each request. Used for tracking and correlation of requests across multiple systems.Non-standard
RangeStringRequests only part of an entity. Useful for downloading files in chunks or for resuming interrupted downloads.RFC 9110, section 14.2
Cache-ControlStringDirectives for caching mechanisms in both requests and responses. Controls caching behavior such as no-cache, no-store, and max-age.RFC 9111, section 5.2
User-AgentStringMUST NOT use. Instead, use client hint-related headers.RFC 9110
Sec-CH-UAStringUser Agent client hints. Provides information about the user agent in a more privacy-preserving way.RFC 8942
Sec-CH-UA-MobileStringIndicates whether the user agent is on a mobile device.RFC 8942
Sec-CH-UA-PlatformStringProvides information about the platform the user agent is running on.RFC 8942
If-Modified-SinceStringMakes the request conditional and only performs successfully if the resource has been modified since the specified date. For example: If-Modified-Since: "Wed, 21 Oct 2015 07:28:00 GMT".RFC 9110, section 13.1.3
If-None-Modified-SinceStringOptional. Makes the request conditional and only performs successfully if the resource has not been modified since the specified date. For example: If-None-Modified-Since: "Wed, 21 Oct 2015 07:28:00 GMT".RFC 9110, section 13.1.4
If-RangeStringAllows a client to request only a portion of a resource if it has not changed since a specified date. If the resource has changed, the client receives the entire resource.RFC 9110, section 14.2.1

Response Headers

HeaderTypeDescriptionRFC Source
Cache-ControlStringDirectives that control caching in browsers and shared caches.RFC 9111, section 5.2
Content-LengthNumberThe length of the returned response body content in bytes.RFC 9110, section 8.6
Content-TypeStringThe media type of the returned response body. Reflects the Accept header of the associated sent request, unless the server was not able to fulfill the client’s demand. Can be a combination of application/json or application/hal+json and a profile parameter with the profile URI of a resource.RFC 9110, section 8.3
Content-DispositionStringSpecifies the presentation style of content in the browser.RFC 6266, section 4.1
DateStringThe timestamp of the response in HTTP-date format. For example: Thu, 7 Jul 2022 16:30:00 GMT.RFC 9110, section 6.6.1
DeprecationStringThe specific point in time at which the resource has been deprecated.RFC 8594
ETagStringThe identifier for a specific version of a resource. Can be part of the response to a GET or HEAD request and used to determine whether two representations of a resource are identical. Use the ETag response header value of a previous request as an If-Match: <entity tag> or If-None-Match: <entity tag> request header in subsequent requests to make changes to a resource (via POST, PUT, PATCH) or to only retrieve the payload if it changed in the meantime (via GET, HEAD). Refer to If-Match and If-None-Match in the table Request headers above.RFC 9110, section 8.8.3
LocationStringThe URI of a resource. This response header is usually sent after creating a new resource.RFC 9110, section 10.2.2
SunsetStringThe specific point in time at which the resource is no longer available, see RFC 8594, section 3.RFC 8594
Set-CookieStringSends cookies from the server to the user agent. Used for session management, personalization, and tracking.RFC 6265
WWW-AuthenticateStringIndicates the authentication scheme that should be used to access the requested entity. Used in 401 Unauthorized responses to prompt the client to authenticate.RFC 9110, section 11.6.1
AllowStringLists the set of HTTP methods supported by a resource. Used in 405 Method Not Allowed responses to inform the client of the allowed methods.RFC 9110, section 10.2.1
Retry-AfterStringIndicates how long the user agent should wait before making a follow-up request. Used in 503 Service Unavailable responses to inform clients when to retry the request.RFC 9110, section 10.2.3
X-RateLimit-LimitStringIndicates the number of allowed requests in the current period for the client. Used for rate limiting to inform clients of their quota.Non-standard
X-RateLimit-RemainingStringIndicates the number of remaining requests in the current period. Used for rate limiting to inform clients of their remaining quota.Non-standard
X-RateLimit-ResetStringIndicates when the rate limit will reset. Used for rate limiting to inform clients of the reset time.Non-standard
X-Request-IDStringA unique identifier for each request. Used for tracking and correlation of requests across multiple systems.Non-standard

Relative ADPs

Reference

Changelog

  • 2024.09.30 Add if-modified-since, if-none-modified-since, if-range.