Learning HTTP

HTTP is a very clever and flexible protocol. Whenever you find yourself making serious use of it, and especially if you end up designing an HTTP interface (which comes up in almost all server-side web programming), I want you to promise me that you will first study the way the protocol actually works.

The reason I ask is that most programmers start working with HTTP with only a very minimal understanding of it. I certainly did. They don’t know how to properly take advantage, or even deal with, features such as caching (a mechanism to prevent repeatedly fetching the same document) and Internet media types (a way to identify the format of documents), and the result is that they build overcomplicated, brittle, wrong-headed wrappers ...

Get Eloquent JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.