HTTP request and response analyzer

Every web request is a few lines of text: a start line, header fields and a body. Paste a request and its response, from your browser's developer tools, a proxy log or curl -v, and each line is explained with the RFC that defines it, along with how long it can be cached and what is wrong with it.

Header fields
12
Warnings
0
Examples
Request
GET /assets/app.3f9a2c.js HTTP/1.1
Host: www.example.com
The host (and port) the request is for. Lets one server and IP address host many sites. RFC 9110 §7.2
User-Agent: Mozilla/5.0
Identifies the client software. RFC 9110 §10.1.5
Accept: */*
Media types the client can handle, with optional q= weights of preference. RFC 9110 §12.5.1
Accept-Encoding: gzip, br
Content codings the client can decode, such as gzip or br; the server may compress the response with one of them. RFC 9110 §12.5.3
Response
HTTP/1.1 200 OK
Date: Tue, 06 Oct 2026 10:00:00 GMT
When the message was generated; caches use it to work out the response's age. RFC 9110 §6.6.1
Content-Type: text/javascript
The media type of the body, such as application/json, and its parameters. RFC 9110 §8.3
Content-Encoding: br
A coding such as gzip applied to the body; the receiver must decode it to get the representation. RFC 9110 §8.4
Content-Length: 48213
The size of the body in bytes, so the receiver knows where the message ends. RFC 9110 §8.6
Cache-Control: public, max-age=31536000, immutable
Caching directives for this message. RFC 9111 §5.2
ETag: "3f9a2c"
An opaque version tag for the representation; a validator for If-None-Match. W/ marks a weak tag. RFC 9110 §8.8.3
Vary: Accept-Encoding
The request headers the response depends on. Caches must keep a separate copy for each combination of their values. RFC 9110 §12.5.5
Age: 3600
Seconds the response has spent in caches since the origin produced it. RFC 9111 §5.1
Findings
  • RequestGET: Retrieve the current representation of the target resource. Safe (read-only), idempotent (repeating it has the same effect, so it can be retried), cacheable. RFC 9110 §9.3.1
  • Response200 OK (success). The request succeeded. RFC 9110 §15.3.1
  • ResponseCaches keep a separate copy for each value of Accept-Encoding.
Caching
Browser cache
fresh for 365 days
Shared cache (CDN, proxy)
fresh for 365 days

max-age gives a freshness lifetime of 31,536,000 s; it is already 3,600 s old (Age), so it can be reused without asking the server for 31,532,400 s.

The next request from the cache
GET /assets/app.3f9a2c.js HTTP/1.1
Host: www.example.com
If-None-Match: "3f9a2c"

After 31,532,400 s the copy is stale; the next request then carries the validators. If nothing changed the server answers 304 Not Modified with no body, and the cached copy is reused for another 31,536,000 s.

How to use the analyzer

Paste a request, a response, or both one after the other. The analyzer accepts raw HTTP/1.1 as it appears on the wire or in a proxy log, and the output of curl -v, where sent lines start with > and received lines with <. Browser developer tools can show a request's raw headers in the network panel. Each header is explained with a link to the section of the RFC that defines it, 53 fields in all; the panel on the right lists problems, how long caches may keep the response, the conditional request a cache would send next, and checks on each cookie.

Everything runs in the page. Even so, remove passwords, tokens and session cookies before pasting real traffic; the address bar keeps what you paste so the link can be shared.

Anatomy of an HTTP message

An HTTP request starts with a request line naming the method, the target (usually a path and query) and the protocol version, such as GET /news?page=2 HTTP/1.1. A response starts with a status line: the version, a three-digit status code and a reason phrase, such as HTTP/1.1 404 Not Found. Both continue with header fields, one Name: value per line, with names case-insensitive; an empty line ends the headers and the body, if any, follows.

Since 2022 the definitions are split: RFC 9110 gives the meaning of methods, status codes and fields for every version of HTTP, RFC 9112 the text format of HTTP/1.1, and RFC 9113 and RFC 9114 the binary framing of HTTP/2 and HTTP/3. The fields are the same in all of them (HTTP/2 and HTTP/3 move the request line into pseudo-headers such as :method and :path), so what this page says about headers applies to every version.

Methods: safe and idempotent

MethodSafeIdempotentTypical use
GETyesyesRead a resource
HEADyesyesRead only the headers
OPTIONSyesyesAsk what is allowed; CORS preflight
PUTnoyesCreate or replace at a known URL
DELETEnoyesRemove
POSTnonoSubmit, create in a collection, run an action
PATCHnonoApply partial changes (RFC 5789)

A safe method does not ask the server to change anything, so crawlers and prefetchers may send it freely. An idempotent method has the same intended effect whether it arrives once or several times, so a client or proxy can resend it after a connection drops without knowing whether the first one got through. That is why retrying a POST, such as a payment, needs extra care, often an idempotency key the server uses to recognise the repeat.

Status codes

The first digit gives the class: 1xx informational, 2xx success, 3xx redirection, 4xx a problem with the request, 5xx a problem at the server. A few pairs are easy to confuse:

  • 301 and 308 are permanent redirects; 302 and 307 temporary. With 301 and 302, browsers turn a POST into a GET when following; 307 and 308 require the same method and body.
  • 303 See Other sends the client to another resource with GET, the usual answer to a form POST so that reloading the result does not resubmit it.
  • 401 Unauthorized means "who are you?" and must carry WWW-Authenticate; 403 Forbidden means "I know, and no".
  • 502 Bad Gateway and 504 Gateway Timeout come from a proxy or load balancer about the server behind it; 503 is the server saying it is overloaded or down for maintenance.

Caching headers and 304

A cache may reuse a stored response without asking the server while it is fresh. RFC 9111 takes the freshness lifetime from s-maxage (shared caches only), then max-age, then Expires minus Date, and subtracts the response's age, which includes the Age header added by caches upstream. In the Static file example, max-age=31536000 gives 31,536,000 s and the response is already 3,600 s old, leaving 31,532,400 s. With none of these headers, a cache may use a heuristic for responses with Last-Modified; RFC 9111 mentions 10% of the time since the last change as typical, which gives the Only Last-Modified example 86,400 s.

When a stored response goes stale, the cache does not have to download it again. It sends a conditional request carrying the response's validators: If-None-Match with the ETag, or If-Modified-Since with Last-Modified. If nothing changed the server answers 304 Not Modified with headers only, and the cache keeps using its copy. no-cache forces this check on every use; no-store forbids keeping a copy at all; private keeps it out of shared caches such as CDNs.

Cookies

A server sets a cookie with a Set-Cookie header, one per cookie, and the browser sends the stored cookies back in a single Cookie header. The attributes decide where and how long: Max-Age or Expires for lifetime (without them, the cookie lasts for the session), Domain and Path for scope, Secure for HTTPS only, HttpOnly to hide it from page scripts, and SameSite to control whether other sites' requests carry it. A session cookie should have all of Secure, HttpOnly and SameSite; in the Login and cookies example, __Host-session gets 0 warnings and theme gets 2 warnings. The __Host- name prefix makes the browser insist on Secure, Path=/ and no Domain, so a subdomain cannot overwrite the cookie.

Where a message ends

Over HTTP/1.1 several messages share one connection, so each must say where its body ends: either Content-Length with the exact number of bytes, or Transfer-Encoding: chunked, which sends the body in pieces, each preceded by its size, and ends with a zero-size piece. A wrong Content-Length makes the receiver wait for bytes that never come, or read the start of the next message as part of this one. A message with both is suspicious: RFC 9112 says Transfer-Encoding wins and lets servers reject it, because a front-end proxy and a back-end server that disagree about the boundary can be made to see a hidden second request. The Common mistakes example has 7 problems, including that one.

HTTP message questions and answers

What does an HTTP request look like?

A start line with the method, the target and the version (GET /index.html HTTP/1.1), then header fields as Name: value lines, then an empty line, then an optional body. A response has the same shape with a status line (HTTP/1.1 200 OK) instead. HTTP/2 and HTTP/3 send the same fields in a binary encoding.

What is the difference between safe and idempotent methods?

A safe method is read-only from the client's point of view: GET, HEAD, OPTIONS and TRACE. An idempotent method has the same effect whether it is sent once or several times: the safe methods plus PUT and DELETE. Clients and proxies may retry idempotent requests after a connection failure; POST and PATCH are neither, so retrying them can repeat the action.

How long can a browser cache a response?

For as long as its freshness lifetime: max-age in Cache-Control, or Expires minus Date, minus the Age the response already has. Without either, a cache may guess from Last-Modified; RFC 9111 suggests 10% of the time since the last change, so a page last modified 10 days before gets 1 day of freshness.

What is the difference between 401 and 403?

401 Unauthorized means the request has no valid credentials and the client should authenticate; it must come with a WWW-Authenticate header saying how. 403 Forbidden means the server understood who is asking and refuses anyway; authenticating again will not help.

What does a 304 Not Modified response mean?

The client asked conditionally, with If-None-Match (an ETag) or If-Modified-Since, and the resource has not changed. The server sends headers only, and the client keeps using its cached copy with the refreshed headers. It saves sending the body again.

Why are Content-Length and Transfer-Encoding together dangerous?

They are two ways of saying where a message ends. If both appear, HTTP/1.1 says Transfer-Encoding wins, and a server may reject the message. When a proxy and the server behind it disagree about which to use, an attacker can hide a second request inside the first: request smuggling.

Further reading

Published Updated