Skip to content
On this page

Request headers

Introduction

HTTP request headers are key-value pairs sent by a client (such as a web browser or API client) to a server as part of an HTTP request. These headers provide additional information about the request, helping the server understand how to process it. They can include details about the client, request type, accepted content, authentication, caching, and more.

Headers play a crucial role in web communication, enabling functionality such as content negotiation, security enforcement, and efficient data transfer. Below is a comprehensive list of commonly used HTTP request headers along with a brief description of their purpose.

Common request headers

Below is a table of common HTTP request headers and info about their usage:

Header NameDescription
Accept-CharsetSpecifies the character sets the client can handle.
Accept-EncodingSpecifies the encoding methods the client can accept.
Accept-LanguageSpecifies the preferred languages for the response.
AcceptSpecifies the media types the client can process.
AuthorizationContains credentials for authentication.
Cache-ControlControls caching behavior of the request.
ConnectionSpecifies control options for the current connection.
Content-LengthIndicates the size of the request body in bytes.
Content-TypeSpecifies the media type of the request body.
CookieSends stored HTTP cookies to the server.
DNT (./Do Not Track/)Indicates the user's tracking preference.
ExpectSpecifies expected behavior from the server.
ForwardedContains information about a forwarded request by a proxy.
FromProvides an email address of the user making the request.
Sec-GpcIndicates the user's PII tracking preferences.
HostSpecifies the domain name of the server handling the request.
If-MatchUsed for conditional requests based on ETag matching.
If-Modified-SinceSends the last modification date to check for updates.
If-None-MatchRequests resources only if they do not match a given ETag.
If-RangeRequests a specific range of data if the entity remains unchanged.
If-Unmodified-SinceRequests resources only if they have not been modified.
OriginIndicates the origin of the request for CORS purposes.
PragmaProvides backward compatibility with HTTP/1.0 caches.
PrioritySpecifies the priority of the request.
Proxy-AuthorizationContains credentials for authenticating with a proxy.
RangeRequests a specific byte range of a resource.
RefererSpecifies the referring webpage for the request.
Sec-Fetch-DestIndicates the destination of a requested resource.
Sec-Fetch-ModeIndicates the request mode used when fetching a resource.
Sec-Fetch-SiteIndicates the context of the request's origin.
TEIndicates supported transfer encodings.
UpgradeRequests an upgrade to a different protocol.
User-AgentIdentifies the client software making the request.
ViaProvides information about intermediaries handling the request.
WarningSends additional information about the status of a request.

Released under the MIT License.