A conversation between computers
Type an address and press Enter: your browser sends a request, a server sends back a response. Every image, stylesheet and API call is one of these little conversations, spoken in HTTP.
Anatomy of a request and response
GET /menu HTTP/1.1 Host: momohouse.example Accept: text/html HTTP/1.1 200 OK Content-Type: text/html; charset=utf-8 Cache-Control: max-age=600 <!doctype html><title>Menu</title>…
- Methods: GET read, POST create, PUT/PATCH update, DELETE remove.
- Status codes: 2xx success (200 OK, 201 Created), 3xx redirect (301, 304 Not Modified), 4xx your mistake (400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found), 5xx the server's mistake (500, 503).
- HTTPS is HTTP encrypted, so nobody in between can read or change it.