[ADP-121] Common HTTP headers
reviewing phase 1
Directly link to headers ADP individually.
Guidance
- SHOULD support common HTTP headers as table described below.
- SHOULD refer other common HTTP headers in RFC 9110.
- MAY check the list of common HTTP headers in IANA: Message Headers and wiki: List of HTTP headers before creating custom headers.
Request Headers
Header | Type | Description | RFC Source |
---|---|---|---|
Accept | String | The 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 |
Authorization | String | The 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-Type | String | The 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-Match | String | Optional. 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-Match | String | Optional. 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-ID | String | A unique identifier for each request. Used for tracking and correlation of requests across multiple systems. | Non-standard |
Range | String | Requests only part of an entity. Useful for downloading files in chunks or for resuming interrupted downloads. | RFC 9110, section 14.2 |
Cache-Control | String | Directives 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-Agent | String | MUST NOT use. Instead, use client hint-related headers. | RFC 9110 |
Sec-CH-UA | String | User Agent client hints. Provides information about the user agent in a more privacy-preserving way. | RFC 8942 |
Sec-CH-UA-Mobile | String | Indicates whether the user agent is on a mobile device. | RFC 8942 |
Sec-CH-UA-Platform | String | Provides information about the platform the user agent is running on. | RFC 8942 |
If-Modified-Since | String | Makes 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-Since | String | Optional. 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-Range | String | Allows 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
Header | Type | Description | RFC Source |
---|---|---|---|
Cache-Control | String | Directives that control caching in browsers and shared caches. | RFC 9111, section 5.2 |
Content-Length | Number | The length of the returned response body content in bytes. | RFC 9110, section 8.6 |
Content-Type | String | The 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-Disposition | String | Specifies the presentation style of content in the browser. | RFC 6266, section 4.1 |
Date | String | The timestamp of the response in HTTP-date format. For example: Thu, 7 Jul 2022 16:30:00 GMT. | RFC 9110, section 6.6.1 |
Deprecation | String | The specific point in time at which the resource has been deprecated. | RFC 8594 |
ETag | String | The 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 |
Location | String | The URI of a resource. This response header is usually sent after creating a new resource. | RFC 9110, section 10.2.2 |
Sunset | String | The specific point in time at which the resource is no longer available, see RFC 8594, section 3. | RFC 8594 |
Set-Cookie | String | Sends cookies from the server to the user agent. Used for session management, personalization, and tracking. | RFC 6265 |
WWW-Authenticate | String | Indicates 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 |
Allow | String | Lists 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-After | String | Indicates 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-Limit | String | Indicates 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-Remaining | String | Indicates the number of remaining requests in the current period. Used for rate limiting to inform clients of their remaining quota. | Non-standard |
X-RateLimit-Reset | String | Indicates when the rate limit will reset. Used for rate limiting to inform clients of the reset time. | Non-standard |
X-Request-ID | String | A unique identifier for each request. Used for tracking and correlation of requests across multiple systems. | Non-standard |
Relative ADPs
Reference
- https://datatracker.ietf.org/doc/html/rfc9110
- http://en.wikipedia.org/wiki/List_of_HTTP_header_fields
Changelog
2024.09.30
Addif-modified-since
,if-none-modified-since
,if-range
.