11/03/2023
What are HTTP headers?
Introduction
Using the Hypertext Transfer Protocol (HTTP), browsers can communicate with web servers to get information to load web pages. When a HTTP request is made, and a HTTP response given by a web server, the request or response is usually accompanied by additional information, contained in a so-called "HTTP header." The additional information in the HTTP headers help to ensure that the data pulled from the web server can be properly displayed in the browser window. In addition to the Content-Type header, the request is typically accompanied by diagnostic information, including (but not limited to): the brand of web server, compression type, and more.
HTTP Request Headers
When a browser performs a “GET” request, details about the request are sent in the HTTP request headers. Below is an example of the details that are passed along in a HTTP request header from a browser’s “GET” request to bunny.net’s website:
Request URL: https://bunny.net/
Request Method: GET
Status Code: 200
Remote Address: :443
Referrer Policy: strict-origin-when-cross-origin
HTTP Response Headers
Just like HTTP request headers, HTTP response headers also contain details about the responses, such as content type (e.g. text), HTTP status code and the character encoding to display characters correctly. If you use a Content Delivery Network (CDN) like bunny.net, the response headers will also show information related to the CDN. Below is an example of a HTTP response header from bunny.net’s website:
cache-control: public, max-age=30
cdn-cache: HIT
cdn-cachedat:
cdn-edgestorageid:
cdn-proxyver: 1.0
cdn-pullzone:
cdn-requestcountrycode:
cdn-requestid:
cdn-requestpullcode: 200
cdn-requestpullsuccess: True
cdn-status: 200
cdn-uid:
content-encoding: br
content-type: text/html; charset=utf-8
date:
server: BunnyCDN-
vary: Accept-Encoding