What an HTTP request really is

Under the URL

Every screen in the PawWalk app worked by sending an HTTP request and reading an HTTP response. Before you reach for a framework, it's worth seeing what those two things actually are β€” because a framework's whole job is to hide this, and you can't reason about what you can't see.

An HTTP request is four things, in plain text over a socket:

  • method β€” the verb: GET, POST, PUT, PATCH, DELETE. What do you want to do?
  • path β€” the resource: /walkers, /bookings/42. To what?
  • headers β€” key/value metadata: Content-Type: application/json, Authorization: Bearer …. How, and who's asking?
  • body β€” the optional payload (JSON for a POST). With what data?