Skip to main content
Hypertext Transfer Protocol:

How to read HTTP response headers

Summary

This article explains three methods to read HTTP response headers: using browser developer tools, command-line utilities like curl, and online tools. You will learn practical steps for each approach.

Introduction #

Hypertext Transfer Protocol (HTTP) response headers are metadata returned by a web server along with the content of a requested resource. They include information such as the HTTP status code, server type, content type, caching policies, and security settings.

Reading response headers can help you troubleshoot problems, verify server behavior, or analyze how a website is structured.

Browser developer tools #

Modern browsers have built-in tools for viewing HTTP response headers in the Network tab. These tools also show request headers, cookies, query strings, and timing information.

Mozilla Firefox #

  • Press F12 or right-click and choose Inspect.
  • Open the Network tab.
  • Reload the page.
  • Select a request and expand the Headers section to see the response headers.

Google Chrome / Microsoft Edge #

  • Right-click the page and select Inspect.
  • Go to the Network tab.
  • Reload the page.
  • Click on the desired request (often the first one).
  • Under the Headers tab, find the Response Headers section.

Command-line tools #

You can use command-line tools to read response headers without a browser.

curl #

The curl tool can be used to fetch headers:

curl -I https://example.com

This sends a HEAD request and displays only the response headers.

For more detail, use:

curl -v https://example.com

This outputs the entire request and response, including headers and status codes. Also see curl cheat sheet.

wget #

The wget command can also show headers using:

wget --server-response https://example.com

This displays server response headers in the console.

http (HTTPie) #

If you have HTTPie installed:

http -v https://example.com

This shows headers, request data, and response in a human-readable format.

Online tools #

Several online services let you inspect HTTP response headers by entering a domain or Uniform Resource Locator (URL).

  1. REDbot
    Visit redbot.org, and enter the URL you want to inspect. You can also set request headers.

  2. WebSniffer
    Go to websniffer.cc and enter the URL you want to inspect. It displays both the request and response headers.

  3. httpbin.org
    This site provides endpoints like https://httpbin.org/headers that return header data in JavaScript Object Notation (JSON) format.

FAQ's #

Most common questions and brief, easy-to-understand answers on the topic:

What are HTTP headers?

HTTP response headers are metadata sent by a server in response to a client request, containing information like content type, caching rules, and server details.

Can I view HTTP headers without developer tools?

Yes, you can use command-line tools like curl -I or online services to inspect headers without browser developer tools.

How do HTTP headers differ from HTML?

HTTP headers are part of the protocol communication before the content, while HTML (Hypertext Markup Language) is the actual document structure.

Why would I need to check HTTP headers?

Checking headers helps with debugging web applications, verifying security headers, and understanding server behavior.

Further readings #

Sources and recommended, further resources on the topic:

Author

Jonas Jared Jacek • J15k

Jonas Jared Jacek (J15k)

Jonas works as project manager, web designer, and web developer since 2001. On top of that, he is a Linux system administrator with a broad interest in things related to programming, architecture, and design. See: https://www.j15k.com/

License

How to read HTTP response headers by Jonas Jared Jacek is licensed under CC BY-SA 4.0.

This license requires that reusers give credit to the creator. It allows reusers to distribute, remix, adapt, and build upon the material in any medium or format, for noncommercial purposes only. To give credit, provide a link back to the original source, the author, and the license e.g. like this:

<p xmlns:cc="http://creativecommons.org/ns#" xmlns:dct="http://purl.org/dc/terms/"><a property="dct:title" rel="cc:attributionURL" href="https://www.ditig.com/how-to-read-http-response-headers">How to read HTTP response headers</a> by <a rel="cc:attributionURL dct:creator" property="cc:attributionName" href="https://www.j15k.com/">Jonas Jared Jacek</a> is licensed under <a href="https://creativecommons.org/licenses/by-sa/4.0/" target="_blank" rel="license noopener noreferrer">CC BY-SA 4.0</a>.</p>

For more information see the Ditig legal page.

All Topics

Random Quote

“Make errors impossible. Making it impossible for the user to make errors is the best way to eliminate error messages.”

Alan Cooper  Software designer and programmerAbout Face, - IT quotes