# Headers

> HTTP request and response headers in API use.

Source: https://apiguide.dev/headers
Full text: https://apiguide.dev/llms/headers.txt

- [Accept header](https://apiguide.dev/headers/accept.md): Specifies the media types that the client is willing to receive in the response.
- [Accept-Encoding header](https://apiguide.dev/headers/accept-encoding.md): Declares what compression algorithms the client supports for the response payload.
- [Accept-Language header](https://apiguide.dev/headers/accept-language.md): Advertises the natural languages the client prefers for the response.
- [Accept-Patch header](https://apiguide.dev/headers/accept-patch.md): Advertises which patch document media types a resource accepts in PATCH requests, and by its presence that PATCH is allowed at all.
- [Accept-Post header](https://apiguide.dev/headers/accept-post.md): Advertises which media types a resource accepts in POST requests, modeled on Accept-Patch and defined by the W3C Linked Data Platform.
- [Accept-Query header](https://apiguide.dev/headers/accept-query.md): Signals that a resource supports the QUERY method and lists the query formats it accepts, as a Structured Field list of media types.
- [Accept-Ranges header](https://apiguide.dev/headers/accept-ranges.md): Advertises whether a server supports range requests for a resource.
- [Accept-Signature header](https://apiguide.dev/headers/accept-signature.md): Asks the other side to sign its message with RFC 9421 HTTP Message Signatures, naming the label, covered components and parameters.
- [Access-Control-Allow-Credentials header](https://apiguide.dev/headers/access-control-allow-credentials.md): Indicates whether the response can be exposed when the CORS request includes credentials.
- [Access-Control-Allow-Headers header](https://apiguide.dev/headers/access-control-allow-headers.md): Lists the request headers that are permitted during the actual CORS request.
- [Access-Control-Allow-Methods header](https://apiguide.dev/headers/access-control-allow-methods.md): Lists the HTTP methods permitted when accessing a resource in response to a CORS preflight.
- [Access-Control-Allow-Origin header](https://apiguide.dev/headers/access-control-allow-origin.md): Specifies which origin(s) are permitted to read the response in a CORS request.
- [Access-Control-Expose-Headers header](https://apiguide.dev/headers/access-control-expose-headers.md): Lists the response headers that browsers are allowed to expose to client-side JavaScript.
- [Access-Control-Max-Age header](https://apiguide.dev/headers/access-control-max-age.md): Specifies how long the results of a CORS preflight request can be cached by the browser.
- [Access-Control-Request-Headers header](https://apiguide.dev/headers/access-control-request-headers.md): Sent by the browser in a CORS preflight to announce the custom headers of the actual request.
- [Access-Control-Request-Method header](https://apiguide.dev/headers/access-control-request-method.md): Sent by the browser in a CORS preflight to announce the method of the actual request.
- [Age header](https://apiguide.dev/headers/age.md): The time in seconds since a cached response was generated at the origin server.
- [Allow header](https://apiguide.dev/headers/allow.md): Lists the HTTP methods supported by the target resource, on a 405 Method Not Allowed or a 2xx OPTIONS response.
- [Alt-Svc header](https://apiguide.dev/headers/alt-svc.md): Advertises another protocol, host or port where the same origin can be reached, which is how clients discover HTTP/3.
- [Authentication-Info header](https://apiguide.dev/headers/authentication-info.md): Returns scheme-specific information to the client after its credentials have been accepted, such as the next nonce in Digest authentication.
- [Authorization header](https://apiguide.dev/headers/authorization.md): Contains the credentials to authenticate the client with the server.
- [Cache-Control header](https://apiguide.dev/headers/cache-control.md): Directives for caching mechanisms in both requests and responses.
- [Cache-Group-Invalidation header](https://apiguide.dev/headers/cache-group-invalidation.md): Sent on a response to an unsafe request, it asks caches to invalidate stored responses in the named cache groups.
- [Cache-Groups header](https://apiguide.dev/headers/cache-groups.md): Tags a cacheable response with one or more group names, so a cache can invalidate every stored response in a group together.
- [Cache-Status header](https://apiguide.dev/headers/cache-status.md): Reports how each cache on the path handled a response: hit or forwarded, why, and how much freshness remains.
- [CDN-Cache-Control header](https://apiguide.dev/headers/cdn-cache-control.md): Cache directives aimed only at CDN caches, letting an origin set edge caching separately from browsers and other caches.
- [Client-Cert header](https://apiguide.dev/headers/client-cert.md): Lets a TLS-terminating reverse proxy pass the client's mTLS certificate to the origin, as a base64 DER byte sequence.
- [Client-Cert-Chain header](https://apiguide.dev/headers/client-cert-chain.md): Carries the intermediate certificates behind a client's mTLS certificate from a TLS-terminating proxy to the origin, as a list of byte sequences.
- [Connection header](https://apiguide.dev/headers/connection.md): Lists control options for the current HTTP/1.1 connection and names the hop-by-hop fields that intermediaries must strip before forwarding.
- [Content-Digest header](https://apiguide.dev/headers/content-digest.md): Carries a hash of the actual message content, so the recipient can check the bytes arrived intact.
- [Content-Disposition header](https://apiguide.dev/headers/content-disposition.md): Indicates whether the body should be displayed inline or treated as a downloadable attachment.
- [Content-Encoding header](https://apiguide.dev/headers/content-encoding.md): Indicates the compression encoding that has been applied to the message body.
- [Content-Language header](https://apiguide.dev/headers/content-language.md): Describes the natural language(s) of the intended audience for the message body.
- [Content-Length header](https://apiguide.dev/headers/content-length.md): Indicates the size of the request or response body in bytes.
- [Content-Location header](https://apiguide.dev/headers/content-location.md): Identifies a URI for the specific representation enclosed in the message, distinct from the redirect or creation target given by Location.
- [Content-Range header](https://apiguide.dev/headers/content-range.md): Indicates which portion of a resource is delivered in a partial response.
- [Content-Security-Policy header](https://apiguide.dev/headers/content-security-policy.md): Tells browsers which sources a document may load and who may frame it. For a JSON API, send the most restrictive policy there is.
- [Content-Type header](https://apiguide.dev/headers/content-type.md): Indicates the media type of the request or response body payload.
- [Cookie header](https://apiguide.dev/headers/cookie.md): Sends previously stored cookies from the client back to the server.
- [Cross-Origin-Resource-Policy header](https://apiguide.dev/headers/cross-origin-resource-policy.md): Tells browsers which sites may load a response through no-cors requests such as img and script tags. Does not affect CORS fetches.
- [Date header](https://apiguide.dev/headers/date.md): The date and time at which the message was originated, sent as an IMF-fixdate in GMT.
- [Deprecation header](https://apiguide.dev/headers/deprecation.md): Signals that a resource is deprecated, carrying the date deprecation takes or took effect as a Structured Field Date.
- [DPoP header](https://apiguide.dev/headers/dpop.md): Carries an RFC 9449 proof-of-possession JWT, signed by the client's private key over the method and URI, binding OAuth tokens to that key.
- [DPoP-Nonce header](https://apiguide.dev/headers/dpop-nonce.md): A server-issued nonce the client must put in its next DPoP proofs, limiting how long a proof can be used or pre-generated.
- [Early-Data header](https://apiguide.dev/headers/early-data.md): Added by an intermediary to mark a request that was received in TLS 1.3 early data (0-RTT) and could be a replay.
- [ETag header](https://apiguide.dev/headers/etag.md): An identifier for a specific version of a resource, used for cache validation.
- [Expect header](https://apiguide.dev/headers/expect.md): Signals that the client expects a particular server behavior before continuing the request.
- [Expires header](https://apiguide.dev/headers/expires.md): The absolute date and time after which a cached response is considered stale.
- [Forwarded header](https://apiguide.dev/headers/forwarded.md): Standard header in which proxies record the client address, protocol and host a request arrived with, replacing the X-Forwarded-* family.
- [From header](https://apiguide.dev/headers/from.md): An email address for the human responsible for the requesting user agent. Crawlers and bots should send it; nobody should trust it.
- [Host header](https://apiguide.dev/headers/host.md): Specifies the target host and port of the resource being requested.
- [Idempotency-Key header](https://apiguide.dev/headers/idempotency-key.md): Custom request header used to prevent duplicate operations (mutations) on the server.
- [If-Match header](https://apiguide.dev/headers/if-match.md): Makes the request conditional; execution occurs only if the client ETag matches the server ETag.
- [If-Modified-Since header](https://apiguide.dev/headers/if-modified-since.md): Makes the request conditional; execution occurs only if the resource has changed since the given date.
- [If-None-Match header](https://apiguide.dev/headers/if-none-match.md): Makes the request conditional; execution occurs only if the client ETag does not match the server ETag.
- [If-Range header](https://apiguide.dev/headers/if-range.md): Makes a range request conditional: send the requested part if the resource is unchanged, otherwise send the whole new representation.
- [If-Unmodified-Since header](https://apiguide.dev/headers/if-unmodified-since.md): Makes a request conditional on the resource not having been modified after the given date.
- [Last-Event-ID header](https://apiguide.dev/headers/last-event-id.md): Sent by an EventSource client when it reconnects to a Server-Sent Events stream, carrying the id of the last event it saw.
- [Last-Modified header](https://apiguide.dev/headers/last-modified.md): The date and time a resource was last changed, used for cache validation.
- [Link header](https://apiguide.dev/headers/link.md): Provides a means to serialize relationships between resources in HTTP headers, commonly used for pagination.
- [Link-Template header](https://apiguide.dev/headers/link-template.md): Like Link, but the target is a URI Template, so a client can build links itself, such as to any item by ID or any page of results.
- [Location header](https://apiguide.dev/headers/location.md): Indicates the URL to redirect the client to, or the URL of a newly created resource.
- [Max-Forwards header](https://apiguide.dev/headers/max-forwards.md): A hop counter for TRACE and OPTIONS that limits how many proxies may forward the request, so you can probe a chain one hop at a time.
- [OData-Version header](https://apiguide.dev/headers/odata-version.md): States which OData protocol version, 4.0 or 4.01, a request or response payload was written in. Services must send it on every response.
- [Origin header](https://apiguide.dev/headers/origin.md): Indicates the origin (scheme, host, and port) that a cross-origin request comes from.
- [Prefer header](https://apiguide.dev/headers/prefer.md): Lets the client request optional, non-critical handling behaviors from the server.
- [Preference-Applied header](https://apiguide.dev/headers/preference-applied.md): Tells the client which of the preferences it sent in Prefer the server actually honored.
- [Priority header](https://apiguide.dev/headers/priority.md): Signals how urgent a response is and whether it can be used incrementally, so HTTP/2 and HTTP/3 servers can schedule bandwidth.
- [Proxy-Authenticate header](https://apiguide.dev/headers/proxy-authenticate.md): Carries the authentication challenge a forward proxy sends with a 407 response before it will relay the request.
- [Proxy-Authentication-Info header](https://apiguide.dev/headers/proxy-authentication-info.md): The proxy counterpart of Authentication-Info: scheme-specific data a proxy returns after accepting Proxy-Authorization credentials.
- [Proxy-Authorization header](https://apiguide.dev/headers/proxy-authorization.md): Carries the credentials a client presents to a forward proxy that demanded authentication with a 407 response.
- [Proxy-Status header](https://apiguide.dev/headers/proxy-status.md): Lets each proxy, gateway or CDN on the path say what it did with a response and, on a 502 or 504, exactly which error it hit.
- [Range header](https://apiguide.dev/headers/range.md): Requests only part of a resource by specifying one or more byte ranges.
- [RateLimit header](https://apiguide.dev/headers/ratelimit.md): Reports the quota currently available to the client under each named rate limit policy, and how long that quota applies.
- [RateLimit-Limit header](https://apiguide.dev/headers/ratelimit-limit.md): Legacy field from early IETF drafts giving the request quota for the current window. Superseded by RateLimit and RateLimit-Policy.
- [RateLimit-Policy header](https://apiguide.dev/headers/ratelimit-policy.md): Advertises the quota policies a server applies to the client, each named and described by quota, window and unit.
- [RateLimit-Remaining header](https://apiguide.dev/headers/ratelimit-remaining.md): Legacy field from early IETF drafts giving the quota left in the current window. Superseded by the r parameter of RateLimit.
- [RateLimit-Reset header](https://apiguide.dev/headers/ratelimit-reset.md): Legacy field from early IETF drafts giving the seconds until the quota resets. Superseded by the t parameter of RateLimit.
- [Referer header](https://apiguide.dev/headers/referer.md): The misspelled request header naming the resource the target URI was obtained from. Optional, often trimmed, and never trustworthy.
- [Referrer-Policy header](https://apiguide.dev/headers/referrer-policy.md): Controls how much of the current URL a browser puts in the Referer header of requests made from a page. Send no-referrer on API responses.
- [Repr-Digest header](https://apiguide.dev/headers/repr-digest.md): Carries a hash of the full selected representation, independent of ranges and of how this message frames it.
- [Retry-After header](https://apiguide.dev/headers/retry-after.md): Tells the client how long to wait before making a follow-up request.
- [Sec-WebSocket-Accept header](https://apiguide.dev/headers/sec-websocket-accept.md): The server's answer to Sec-WebSocket-Key: a base64 SHA-1 of the key plus a fixed GUID, confirming it accepts the WebSocket connection.
- [Sec-WebSocket-Extensions header](https://apiguide.dev/headers/sec-websocket-extensions.md): Negotiates WebSocket protocol extensions such as permessage-deflate: the client offers, the server accepts a subset.
- [Sec-WebSocket-Key header](https://apiguide.dev/headers/sec-websocket-key.md): A random base64 nonce in the WebSocket opening handshake, which the server hashes into Sec-WebSocket-Accept to prove it understood the request.
- [Sec-WebSocket-Protocol header](https://apiguide.dev/headers/sec-websocket-protocol.md): Negotiates the application subprotocol for a WebSocket connection: the client lists what it speaks, the server picks one.
- [Sec-WebSocket-Version header](https://apiguide.dev/headers/sec-websocket-version.md): The WebSocket protocol version in the opening handshake. Always 13; a server that disagrees replies with the versions it supports.
- [Server header](https://apiguide.dev/headers/server.md): Names the software the origin server used to handle the request. Optional, and best kept short or left out of API responses.
- [Server-Timing header](https://apiguide.dev/headers/server-timing.md): Lets a server report named backend timings, such as database or cache time, which browsers expose in developer tools and to JavaScript.
- [Set-Cookie header](https://apiguide.dev/headers/set-cookie.md): Instructs the client to store a cookie and return it on subsequent requests.
- [Signature header](https://apiguide.dev/headers/signature.md): Carries one or more RFC 9421 HTTP Message Signature values, each keyed by the label that matches its entry in Signature-Input.
- [Signature-Input header](https://apiguide.dev/headers/signature-input.md): Declares, per signature label, which message components an RFC 9421 HTTP Message Signature covers and with which parameters it was made.
- [Strict-Transport-Security header](https://apiguide.dev/headers/strict-transport-security.md): Tells browsers to contact this host only over HTTPS for a set period, refusing plaintext connections and certificate errors.
- [Sunset header](https://apiguide.dev/headers/sunset.md): The date after which a resource is expected to become unavailable.
- [TE header](https://apiguide.dev/headers/te.md): Tells the server whether the client accepts trailer fields and, in HTTP/1.1, which transfer codings besides chunked it can take.
- [traceparent header](https://apiguide.dev/headers/traceparent.md): W3C Trace Context header carrying the trace ID, the caller's span ID and the sampling flag, so one request can be followed across every service it touches.
- [tracestate header](https://apiguide.dev/headers/tracestate.md): W3C Trace Context companion to traceparent that carries vendor-specific trace data as an ordered list of key=value entries.
- [Trailer header](https://apiguide.dev/headers/trailer.md): Announces in the header section which fields the sender expects to send as trailers, after the body.
- [Transfer-Encoding header](https://apiguide.dev/headers/transfer-encoding.md): Lists the transfer codings, such as chunked, applied to an HTTP/1.1 message body so it can be framed on the connection.
- [Unencoded-Digest header](https://apiguide.dev/headers/unencoded-digest.md): Carries a hash of the full representation with no content coding applied, so a client that decoded gzip or br can verify what it got.
- [Upgrade header](https://apiguide.dev/headers/upgrade.md): Invites the server to switch an HTTP/1.1 connection to a different protocol, most often WebSocket.
- [User-Agent header](https://apiguide.dev/headers/user-agent.md): Identifies the client software making the request, as a list of product tokens in decreasing order of significance.
- [Vary header](https://apiguide.dev/headers/vary.md): Lists the request headers a response depends on, controlling cache key selection.
- [Via header](https://apiguide.dev/headers/via.md): Records each proxy or gateway a message passed through, with the protocol version it was received over.
- [Want-Content-Digest header](https://apiguide.dev/headers/want-content-digest.md): Asks the other side to send a Content-Digest, and says which hash algorithms it would prefer, from 1 to 10.
- [Want-Repr-Digest header](https://apiguide.dev/headers/want-repr-digest.md): Asks the other side to send a Repr-Digest of the full selected representation, with a weighted preference for hash algorithms.
- [Want-Unencoded-Digest header](https://apiguide.dev/headers/want-unencoded-digest.md): Asks the other side to send an Unencoded-Digest of the representation with no content coding, with a weighted algorithm preference.
- [WWW-Authenticate header](https://apiguide.dev/headers/www-authenticate.md): Defines the authentication method that should be used to gain access to the resource.
- [X-Content-Type-Options header](https://apiguide.dev/headers/x-content-type-options.md): Tells browsers not to second-guess the declared Content-Type, blocking scripts and stylesheets served with the wrong media type.
- [X-Forwarded-For header](https://apiguide.dev/headers/x-forwarded-for.md): De facto request header listing the client and proxy IP addresses a request passed through. Trivially spoofed unless parsed from the right.
- [X-Forwarded-Host header](https://apiguide.dev/headers/x-forwarded-host.md): De facto request header in which a proxy records the Host the client originally asked for. Spoofable, and a common source of host header attacks.
- [X-Forwarded-Proto header](https://apiguide.dev/headers/x-forwarded-proto.md): De facto request header in which a proxy records whether the client connected over http or https. The standard form is Forwarded proto.
- [X-Frame-Options header](https://apiguide.dev/headers/x-frame-options.md): Legacy header that tells browsers whether a response may be shown in a frame. Superseded by CSP frame-ancestors, but still worth sending as DENY.
- [X-HTTP-Method-Override header](https://apiguide.dev/headers/x-http-method-override.md): De facto request header that tunnels another method, such as PUT or DELETE, through a POST. A workaround that can bypass method-based security.
- [X-RateLimit-Limit header](https://apiguide.dev/headers/x-ratelimit-limit.md): De facto header giving the request quota for the current rate limit window. Never standardized; its meaning varies by API.
- [X-RateLimit-Remaining header](https://apiguide.dev/headers/x-ratelimit-remaining.md): De facto header giving the requests left in the current rate limit window. Never standardized; superseded by the r parameter of RateLimit.
- [X-RateLimit-Reset header](https://apiguide.dev/headers/x-ratelimit-reset.md): De facto header saying when the rate limit window resets. Sent as seconds, milliseconds, a Unix timestamp or a date, depending on the API.
- [X-Request-ID header](https://apiguide.dev/headers/x-request-id.md): De facto header carrying a unique ID for one request, echoed in the response and written to every log line so a failure can be traced.
