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: <server_IP>: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: <cache_date>
cdn-edgestorageid: <edge_storage_id>
cdn-proxyver: 1.0
cdn-pullzone: <pullzone_id>
cdn-requestcountrycode: <country_code>
cdn-requestid: <request_id>
cdn-requestpullcode: 200
cdn-requestpullsuccess: True
cdn-status: 200
cdn-uid: <uid>
content-encoding: br
content-type: text/html; charset=utf-8
date: <date>
server: BunnyCDN-<node_id>
vary: Accept-Encoding

Glossary

HTTP

HTTP is a protocol used to connect to web servers by web browsers to request content to view. This is also used to transfer larger files, and is often used for software updates.

HTTP Status Codes

HTTP Status Codes are a series of 3-digit numbers that represent client/server errors -- even redirection can be done with the appropriate headers.

HTTP Headers

HTTP Headers are used to relay information between a server and a client (i.e. responses from a server will contain these "headers").