HTTP is a stateless request/response protocol for the web. HTTPS = HTTP over TLS: data is encrypted, the server is verified by a certificate, and it uses port 443.
| Method | Use |
|---|---|
| GET | Read data |
| POST | Create / submit data |
| PUT | Replace a resource |
| PATCH | Update part of a resource |
| DELETE | Remove a resource |
HTTP status codes
| Code | Meaning |
|---|---|
| 1xx | Informational |
| 200 OK | Success |
| 201 Created | Resource created |
| 301 / 302 | Moved permanently / temporarily (redirect) |
| 304 | Not modified (use cache) |
| 400 | Bad request |
| 401 | Unauthorised (login needed) |
| 403 | Forbidden |
| 404 | Not found |
| 500 | Internal server error |
| 502 / 503 | Bad gateway / service unavailable |
Q & A
-
What happens when you type a URL and press Enter?DNS lookup gives the IP → TCP handshake (and TLS handshake for HTTPS) → browser sends an HTTP request → server sends the response → browser parses HTML, loads CSS/JS/images and renders the page.
-
Why is HTTP stateless and how do sites remember you?Each request is independent. Sites use cookies, sessions or tokens (JWT) to keep state.