Skip to Content
Navigation:

A stick figure smiling

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!

Image of a comic. To read the full HTML alt text, click "read the transcript". browse more comics! get the zine!
read the transcript!

Every HTTP request and respnse has headers. Headers are a way for the browser or server to send extra information!

Firefox: Accept-Encoding:gzip

This means “I understand compressed responses”

Headers have a name and a value.

Accept-Encoding is the name, gzip is the value.

Header names aren’t case sensitive:

aCcEpT-eNcOdIng: gzip is totally valid.

There are a few different kinds of headers:

  • Describe the body: Content-Type: image/png Content-Encoding: gzip Content-Length: 12345 Content-Language: es-ES
  • Ask for a specific kind of response

    Accept: image/png
    Range: bytes=l-10
    Accept-Encoding: gzip
    Accept-Language: es-ES
    

    (Every Accept-header has a corresponding Content-header)

  • Manage caches:

    ETag: "abc123"
    If-None-Match: "abc123"
    Vary: Accept-Encoding
    If-Modified-Since: 3 Aug 2019  13:00:00 GMT
    Last-Modified: 3 Feb 2018 11:00:00 GMT
    Expires: 27 Sep 2019 13:07:49 GMT 
    Cache-Control: public, max-age=300
    
  • Say where the request comes from:

    User-Agent: curl
    Referer: https://examplecat.com
    
  • Cookies:

    Set-Cookie: name=julia; HttpOnly (server -> client)
    Cookie: name=julia               (client -> server)
    

and more!

Saturday Morning Comics!

Want another comic like this in your email every Saturday? Sign up here!

I'll send you one of my favourite comics from my archives every Saturday.
© Julia Evans 2024 | All rights reserved (see the FAQ for notes about licensing)