Here's a preview from my zine, HTTP: Learn Your Browser's Language! If you want to see more comics like this, sign up for my saturday comics newsletter or browse more comics!
get the zine!
read the transcript!
HTTP responses have:
- a status code (200 OK! 404 not found!)
- headers
- a body (HTML, an image, JSON, etc)
Here’s the HTTP response from examplecat.com/cat.txt:
HTTP/1.1 200 OK
status
Accept-Ranges: bytes
Cache-Control: public, max-age=0
Content-Length: 33
Content-Type: text/plain; charset=UTF-8 Date: Mon, 09 Sep 2019 01:57:35 GMT
Etag: "ac5affa59f554a1440043537ae973790-ssl"
Strict-Transport-Security: max-age=31536000
Age: 0
Server: Netlify
[ASCII image of a cat, labelled "cat!" with a smiley face]
The first line, HTTP/1.1 200 OK is the status code. “200” is the status.
The lines from Accept-Ranges to Server are the headers.
The cat picture is the body.
There are a few kinds of response headers:
- when the resource was sent/modified:
Date: Mon, 09 Sep 2019 01:57:35 GMT
Last-Modified: 3 Feb 2017 13:00:00 GMT
- about the response body:
Content-Language: en-US
Content-Length: 33
Content-Type: text/plain; charset=UTF-8
Content-Encoding: gzip
- caching:
ETag: "ac5affa..."
Vary: Accept-Encoding
Age: 255
Cache-Control: public, max-age=0
- security: (see page 25)
X-Frame-Options: DENY
X-XSS-Protection: 1
Strict-Transport-Security: max-age=31536000
Content-Security-Policy: default-src https:
- and more:
Connection: keep-alive
Accept-Ranges: bytes
Via: nginx
Set-Cookie: cat-darcy; HttpOnly; expires=27-Feb-2020 13:18:57 GMT;