# HTTP and HTTPS

> Know the request/response model, methods, status codes and headers that every web service, load balancer and health check speaks. Free notes, key concepts,...

Canonical: https://www.internhack.in/roadmaps/tracks/devops/http-https
Last updated: 2026-11-28

Know the request/response model, methods, status codes and headers that every web service, load balancer and health check speaks.

Beginner · about 5 hours · difficulty 2/5

Learn first: [DNS in Practice](https://www.internhack.in/roadmaps/tracks/devops/dns)

HTTP is the language of almost every service you will operate. Health checks, API gateways, CDNs, load balancers and ingress controllers all make decisions based on HTTP details.

### Fundamentals

- **Request**: method (`GET`, `POST`, `PUT`, `PATCH`, `DELETE`), path, headers, optional body.
- **Response**: status code, headers, body.
- **Status codes**: 2xx success, 3xx redirects (301 vs 302), 4xx client errors (400, 401, 403, 404, 429), 5xx server errors (500, 502 bad gateway, 503 unavailable, 504 gateway timeout). For ops, 502 and 504 usually mean "the proxy could not get a good answer from the upstream".
- **Headers** you will touch: `Host`, `Content-Type`, `Authorization`, `Cache-Control`, `X-Forwarded-For`, `X-Request-ID`.

### Versions

HTTP/1.1 (keep-alive), **HTTP/2** (multiplexing over one connection) and **HTTP/3** over QUIC/UDP. HTTPS is HTTP inside TLS.

### Operational topics

Caching and CDNs, cookies and sessions (sticky sessions), CORS, compression, timeouts and retries (only retry idempotent requests), and rate limiting.

### Tools

`curl -v`, `curl -I`, `curl -w '%{time_total}'`, browser dev tools, and `httpie`.

**Good enough to move on:** you can read a raw request and response, explain what a 502 versus a 504 means at a proxy, and time each phase of a request with curl.

## Key concepts

- **Methods and idempotency**
- **Status codes**
- **Headers and X-Forwarded-\***
- **HTTP/1.1, HTTP/2, HTTP/3**
- **Caching and CDNs**
- **CORS and cookies**
- **curl for debugging**

## Mini project

Write a curl-based script that reports DNS time, connect time, TLS time and time to first byte for a list of URLs, and run it against a site behind a CDN and one without.

## Check yourself

Why is it safe for a load balancer to retry a failed GET but risky to retry a POST?

## Free resources

- [MDN: HTTP](https://developer.mozilla.org/en-US/docs/Web/HTTP) (MDN)
- [curl documentation](https://curl.se/docs/) (curl.se)

Previous: [DNS in Practice](https://www.internhack.in/roadmaps/tracks/devops/dns) · Next: [TLS and Certificates](https://www.internhack.in/roadmaps/tracks/devops/tls-certificates)

## More in Networking You Will Actually Debug

- [How the Internet Works: TCP/IP and the OSI Model](https://www.internhack.in/roadmaps/tracks/devops/internet-tcpip)
- [DNS in Practice](https://www.internhack.in/roadmaps/tracks/devops/dns)
- [HTTP and HTTPS](https://www.internhack.in/roadmaps/tracks/devops/http-https)
- [TLS and Certificates](https://www.internhack.in/roadmaps/tracks/devops/tls-certificates)
- [Load Balancing and Proxies](https://www.internhack.in/roadmaps/tracks/devops/load-balancing-proxies)
- [Firewalls, Security Groups and NAT](https://www.internhack.in/roadmaps/tracks/devops/firewalls-nat)
- [SSH, Bastions and VPNs](https://www.internhack.in/roadmaps/tracks/devops/ssh-vpn)

## Related

- [Roadmaps](https://www.internhack.in/roadmaps)
- [DevOps Engineer Roadmap](https://www.internhack.in/roadmaps/tracks/devops)
