rest api cheat sheet: http methods, status codes, headers and auth, query params and pagination
Stacks · 13 min read · posted Nov 30, 2026, 9:30 pm
Most of working with a REST API comes down to five things: HTTP methods, status codes, headers and auth, query params, and pagination. Once you can read a request and the response it gets, any API's docs get a lot easier to follow.
This is the cheat sheet from the reel. It covers the five things in it, in the same order. For each one you get when you reach for it, the requests with the output they really gave, the mistake that usually bites, and something to try. There's a quick lookup table and a status code table first.
You don't need an account anywhere to follow along. The next section has a small server you save as one file and run on your own machine, and every example talks to it. The reel's cards ran on the same server code, with smaller lists of users.
Everything here was run with curl 8.7.1 on macOS, against that server started with Python 3.15.0, and the output is pasted the way it came back. The server only uses Python's standard library, and it also ran on Python 3.9.6. Each section starts from a freshly started server, so the ids match what you'll see. The Date lines will show your own date and time.
the quick lookup
| i want to ... | run |
|---|---|
| read a list | curl localhost:8000/users |
| read one thing | curl localhost:8000/users/1 |
| create something | curl --json '{"name": "Lea"}' localhost:8000/users |
| replace something | curl -X PUT --json '{"name": "Kai"}' localhost:8000/users/2 |
| change one field | curl -X PATCH --json '{"role": "pm"}' localhost:8000/users/5 |
| delete something | curl -X DELETE localhost:8000/users/4 |
| see the status line and headers | add -i |
| get just the status code | curl -s -o /dev/null -w "%{http_code}\n" <url> |
| make a script stop on a 4xx or 5xx | add -f |
| send a token | -H "Authorization: Bearer fake-123" |
| filter and sort | curl "localhost:8000/users?role=dev&sort=name" |
| get one page | curl "localhost:8000/users?page=2&limit=2" |
the status codes worth knowing
The first digit is the family. 2xx means it worked, 4xx means something about your request was wrong, 5xx means the server failed. The names are the official ones.
| code | name | what it means | the practice server sends it when |
|---|---|---|---|
| 200 | OK | it worked, here's the result | a read, update or list works |
| 201 | Created | a new thing was made | POST /users or POST /notes works |
| 204 | No Content | it worked, there's no body | DELETE works |
| 301 | Moved Permanently | the thing lives at a new URL now | never |
| 304 | Not Modified | your cached copy is still good | never |
| 400 | Bad Request | the request doesn't make sense | the body has no name, the JSON is broken, page=0 |
| 401 | Unauthorized | the server doesn't know who you are | no token, or a token it doesn't know |
| 403 | Forbidden | it knows who you are, and the answer is no | a normal user asks for /admin |
| 404 | Not Found | nothing at that URL | a user id that doesn't exist |
| 405 | Method Not Allowed | that URL doesn't take that method | DELETE /users |
| 409 | Conflict | it clashes with what's already there | never |
| 415 | Unsupported Media Type | the body isn't in a format it reads | a body sent without Content-Type: application/json |
| 422 | Unprocessable Content | the format is fine, the values aren't | never (this server uses 400) |
| 429 | Too Many Requests | slow down, you hit a rate limit | never |
| 500 | Internal Server Error | the server hit a bug | GET /broken |
| 502 | Bad Gateway | a server in front got a bad answer from the one behind it | never |
| 503 | Service Unavailable | the server is down or overloaded for now | never |
422 used to be called Unprocessable Entity, and older docs and libraries still use that name.
the practice server
Save this as rest_api.py:
"""rest_api.py: a tiny REST API to practise on. Standard library only.
Run it with: python3 rest_api.py (stop it with Ctrl+C)"""
import json
import re
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
from urllib.parse import parse_qs, urlsplit
TOKENS = {"fake-123": {"user": 1, "admin": False}, "fake-admin": {"user": 2, "admin": True}} # placeholders, not real tokens
class API(BaseHTTPRequestHandler):
protocol_version = "HTTP/1.1"
def version_string(self):
return "rest-demo"
def send(self, status, body=None, *headers):
data = b"" if body is None else (json.dumps(body, separators=(",", ":")) + "\n").encode()
self.send_response(status)
for name, value in headers:
self.send_header(name, value)
if body is not None:
self.send_header("Content-Type", "application/json")
if status != 204:
self.send_header("Content-Length", str(len(data)))
self.end_headers()
self.wfile.write(data)
def json_body(self):
"""The request body as a dict, or None once an error has been sent."""
if not self.headers.get("Content-Type", "").startswith("application/json"):
return self.send(415, {"error": "send JSON"})
try:
body = json.loads(self.body)
except ValueError:
return self.send(400, {"error": "invalid JSON"})
if not isinstance(body, dict):
return self.send(400, {"error": "send a JSON object"})
body.pop("id", None) # the server picks ids
return body
def caller(self):
"""Who the Authorization header says this is, or None once a 401 has been sent."""
auth = self.headers.get("Authorization")
if not auth:
return self.send(401, {"error": "no token"}, ("WWW-Authenticate", "Bearer"))
who = TOKENS.get(auth.removeprefix("Bearer "))
if not auth.startswith("Bearer ") or not who:
return self.send(401, {"error": "bad token"}, ("WWW-Authenticate", "Bearer"))
return who
def do_GET(self):
self.route("GET")
def do_POST(self):
self.route("POST")
def do_PUT(self):
self.route("PUT")
def do_PATCH(self):
self.route("PATCH")
def do_DELETE(self):
self.route("DELETE")
def route(self, method):
self.body = self.rfile.read(int(self.headers.get("Content-Length", 0)))
url = urlsplit(self.path)
args = {k: v[-1] for k, v in parse_qs(url.query).items()}
users, one = self.server.users, re.fullmatch(r"/users/(\d+)", url.path)
try:
if url.path == "/users" and method == "GET":
return self.list_users(users, args)
if url.path == "/users" and method == "POST":
body = self.json_body()
if body is None:
return
if "name" not in body:
return self.send(400, {"error": "name missing"})
uid = max(users, default=0) + 1
users[uid] = {"id": uid, **body}
return self.send(201, users[uid], ("Location", f"/users/{uid}"))
if url.path == "/users":
return self.send(405, {"error": "method not allowed"}, ("Allow", "GET, POST"))
if one:
uid = int(one[1])
if uid not in users:
return self.send(404, {"error": "no such user"})
if method == "GET":
return self.send(200, users[uid])
if method == "DELETE":
del users[uid]
return self.send(204)
body = self.json_body()
if body is None:
return
if method == "PUT": # PUT replaces the whole user
if "name" not in body:
return self.send(400, {"error": "name missing"})
users[uid] = {"id": uid, **body}
else: # PATCH changes only the fields sent
users[uid].update(body)
return self.send(200, users[uid])
if url.path == "/me" and method == "GET":
who = self.caller()
return who and self.send(200, users[who["user"]])
if url.path == "/admin" and method == "GET":
who = self.caller()
if who and not who["admin"]:
return self.send(403, {"error": "admins only"})
return who and self.send(200, {"users": len(users)})
if url.path == "/notes" and method == "POST":
if not self.caller():
return
body = self.json_body()
if body is None:
return
if "text" not in body:
return self.send(400, {"error": "text missing"})
note = {"id": len(self.server.notes) + 1, "text": body["text"]}
self.server.notes.append(note)
return self.send(201, note)
if url.path == "/broken":
raise RuntimeError("this route has a bug on purpose")
return self.send(404, {"error": "not found"})
except Exception as err:
self.log_error("%r", err)
return self.send(500, {"error": "server error"})
def list_users(self, users, args):
page, limit, sort = args.pop("page", "1"), args.pop("limit", "10"), args.pop("sort", None)
if not (page.isdigit() and limit.isdigit() and int(page) > 0 and int(limit) > 0):
return self.send(400, {"error": "page and limit must be whole numbers above 0"})
rows = [u for u in users.values() if all(str(u.get(k)) == v for k, v in args.items())]
if sort:
key = sort.removeprefix("-")
if not all(key in u for u in users.values()):
return self.send(400, {"error": f"can't sort by {key}"})
rows.sort(key=lambda u: u[key], reverse=sort.startswith("-"))
start = (int(page) - 1) * int(limit)
return self.send(200, rows[start:start + int(limit)])
if __name__ == "__main__":
server = ThreadingHTTPServer(("127.0.0.1", 8000), API)
server.users = {u["id"]: u for u in [
{"id": 1, "name": "Zoe", "role": "dev"}, {"id": 2, "name": "Kai", "role": "pm"},
{"id": 3, "name": "Ana", "role": "dev"}, {"id": 4, "name": "Ben", "role": "pm"},
{"id": 5, "name": "Mia", "role": "dev"}]}
server.notes = []
print("listening on http://localhost:8000")
server.serve_forever()
Start it, and leave that terminal open:
$ python3 rest_api.py
listening on http://localhost:8000
In a second terminal:
$ curl localhost:8000/users
[{"id":1,"name":"Zoe","role":"dev"},{"id":2,"name":"Kai","role":"pm"},{"id":3,"name":"Ana","role":"dev"},{"id":4,"name":"Ben","role":"pm"},{"id":5,"name":"Mia","role":"dev"}]
Every request also shows up as a log line in the first terminal. Stop the server with Ctrl+C. It keeps everything in memory, so restarting it puts the five users back.
| route | does |
|---|---|
GET /users |
the list, with ?role=, ?sort=, ?page= and ?limit= |
POST /users |
makes a user, needs a name |
GET, PUT, PATCH, DELETE /users/<id> |
one user |
GET /me |
the user a token belongs to |
GET /admin |
admins only |
POST /notes |
needs a token and a text |
GET /broken |
has a bug on purpose, for a 500 |
There are two made-up tokens. fake-123 belongs to user 1 and isn't an admin. fake-admin belongs to user 2 and is. They're placeholders. A real API hands you a token after you log in or create a key.
1. http methods
When you reach for it. Every request. The URL says which thing, the method says what to do to it.
The idea. One resource, /users, and four or five verbs:
| method | does | same result if you send it twice? |
|---|---|---|
| GET | reads, changes nothing | yes |
| POST | creates a new one | no, you get two |
| PUT | replaces the whole thing with what you send | yes |
| PATCH | changes only the fields you send | not guaranteed |
| DELETE | removes it | yes, the second one just gets a 404 |
The requests.
$ curl localhost:8000/users/1
{"id":1,"name":"Zoe","role":"dev"}
$ curl -X POST localhost:8000/users -H "Content-Type: application/json" -d '{"name": "Lea", "role": "dev"}'
{"id":6,"name":"Lea","role":"dev"}
$ curl --json '{"name": "Sam", "role": "pm"}' localhost:8000/users
{"id":7,"name":"Sam","role":"pm"}
$ curl -X PUT --json '{"name": "Kai", "role": "lead"}' localhost:8000/users/2
{"id":2,"name":"Kai","role":"lead"}
$ curl -i -X DELETE localhost:8000/users/4
HTTP/1.1 204 No Content
Server: rest-demo
Date: Mon, 30 Nov 2026 08:17:40 GMT
$ curl localhost:8000/users
[{"id":1,"name":"Zoe","role":"dev"},{"id":2,"name":"Kai","role":"lead"},{"id":3,"name":"Ana","role":"dev"},{"id":5,"name":"Mia","role":"dev"},{"id":6,"name":"Lea","role":"dev"},{"id":7,"name":"Sam","role":"pm"}]
curl uses GET unless you tell it otherwise. -X sets the method. -d sends a body and switches to POST. --json sends a body, sets Content-Type: application/json and Accept: application/json, and also switches to POST, so it's the short way to write the second command. It needs curl 7.82 or newer. The DELETE came back as 204 No Content: it worked, and there's no body to show.
PUT vs PATCH. PATCH changes the fields you send and keeps the rest. PUT replaces the whole user, so anything you leave out is gone. Here user 5 starts as {"id":5,"name":"Mia","role":"dev"}:
$ curl -X PATCH --json '{"role": "pm"}' localhost:8000/users/5
{"id":5,"name":"Mia","role":"pm"}
$ curl -X PUT --json '{"role": "lead"}' localhost:8000/users/5
{"error":"name missing"}
$ curl -X PUT --json '{"name": "Mia"}' localhost:8000/users/5
{"id":5,"name":"Mia"}
The PATCH changed the role and kept the name. The first PUT was refused, because a whole user needs a name. The second PUT went through, and Mia's role is gone, because the PUT didn't include one.
What bites. Sending JSON without saying it's JSON. A plain -d labels the body as form data, application/x-www-form-urlencoded, and this server refuses it. Many servers do the same, or quietly read an empty body. The other one is retrying a POST. Every POST makes a new user, so a retry after a timeout can leave you with two:
$ curl -d '{"name": "Lea"}' localhost:8000/users
{"error":"send JSON"}
$ curl --json '{"name": "Lea"}' localhost:8000/users
{"id":6,"name":"Lea"}
$ curl --json '{"name": "Lea"}' localhost:8000/users
{"id":7,"name":"Lea"}
Try it.
- Make a user, rename them with PATCH, then delete them. Say each status code out loud before you press enter.
- Send the same PUT twice and the same POST twice. Then
curl localhost:8000/usersand count. - Delete user 3 twice. What does the second one get, and why is that still "the same result"?
2. status codes
When you reach for it. Before you read a response body. The status says whether the body is the thing you asked for or an error.
The idea. Look at the first digit. 2xx worked. 4xx means change the request: a missing field, a missing token, a wrong id. 5xx means the problem is on the server's side, so changing your request usually won't help. A 503 can clear up on its own, a 500 from a bug won't. -i shows the status line and the response headers above the body:
$ curl -i --json '{"name": "Lea"}' localhost:8000/users
HTTP/1.1 201 Created
Server: rest-demo
Date: Mon, 30 Nov 2026 08:17:40 GMT
Location: /users/6
Content-Type: application/json
Content-Length: 22
{"id":6,"name":"Lea"}
$ curl -i --json '{}' localhost:8000/users
HTTP/1.1 400 Bad Request
Server: rest-demo
Date: Mon, 30 Nov 2026 08:17:40 GMT
Content-Type: application/json
Content-Length: 25
{"error":"name missing"}
$ curl -i localhost:8000/users/99
HTTP/1.1 404 Not Found
Server: rest-demo
Date: Mon, 30 Nov 2026 08:17:40 GMT
Content-Type: application/json
Content-Length: 25
{"error":"no such user"}
$ curl -i -X DELETE localhost:8000/users
HTTP/1.1 405 Method Not Allowed
Server: rest-demo
Date: Mon, 30 Nov 2026 08:17:40 GMT
Allow: GET, POST
Content-Type: application/json
Content-Length: 31
{"error":"method not allowed"}
$ curl -i localhost:8000/broken
HTTP/1.1 500 Internal Server Error
Server: rest-demo
Date: Mon, 30 Nov 2026 08:17:40 GMT
Content-Type: application/json
Content-Length: 25
{"error":"server error"}
The 201 came with a Location header saying where the new user lives. The 405 came with an Allow header listing what that URL does take. The 500 told the caller nothing useful, which is normal. The detail went to the server's log, in the first terminal:
127.0.0.1 - - [30/Nov/2026 21:17:40] RuntimeError('this route has a bug on purpose')
127.0.0.1 - - [30/Nov/2026 21:17:40] "GET /broken HTTP/1.1" 500 -
What bites. Scripts that never look at the status. Without -f, curl treats a 404 as success: it prints the error body and exits with 0. With -f it fails with exit code 22. -w prints just the code:
$ curl localhost:8000/users/99; echo "exit $?"
{"error":"no such user"}
exit 0
$ curl -f localhost:8000/users/99; echo "exit $?"
curl: (22) The requested URL returned error: 404
exit 22
$ curl -s -o /dev/null -w "%{http_code}\n" localhost:8000/users/99
404
Try it.
- Get the server to send each of 200, 201, 204, 400, 401, 403, 404, 405, 415 and 500. Every one of them is reachable with what's in this guide.
- Send
{"name":(broken JSON) to POST /users and read the error. - Write a two-line script that prints "saved" only when a POST came back 201.
3. headers and auth
When you reach for it. When an API needs to know who you are, or what format you're sending.
The idea. Headers are Name: value lines that travel with the request, before the body. Two do most of the work. Authorization: Bearer <token> says who you are. Content-Type: application/json says the body is JSON. The response has headers of its own, and its Content-Type tells you how to read what came back. -H adds a header:
$ curl -i localhost:8000/me
HTTP/1.1 401 Unauthorized
Server: rest-demo
Date: Mon, 30 Nov 2026 08:17:40 GMT
WWW-Authenticate: Bearer
Content-Type: application/json
Content-Length: 21
{"error":"no token"}
$ curl -H "Authorization: Bearer fake-123" localhost:8000/me
{"id":1,"name":"Zoe","role":"dev"}
$ curl -H "Authorization: Bearer wrong" localhost:8000/me
{"error":"bad token"}
$ curl -H "Authorization: fake-123" localhost:8000/me
{"error":"bad token"}
$ curl -H "Authorization: Bearer fake-123" --json '{"text": "buy milk"}' localhost:8000/notes
{"id":1,"text":"buy milk"}
$ curl -H "Authorization: Bearer fake-123" -d '{"text": "buy milk"}' localhost:8000/notes
{"error":"send JSON"}
No token got a 401, and a WWW-Authenticate: Bearer header saying what kind of credentials it wants. The token got Zoe, user 1. A token the server doesn't know gets a 401 too. So does the right token without the word Bearer in front of it, which is an easy one to miss. The last two show both headers at once: with the token and --json, the note is made. With the token and a plain -d, it's refused for the format.
401 vs 403. 401 means "I don't know who you are": no token, or a bad one. Fix it by sending a valid token. 403 means "I know who you are, and you're not allowed": a different token won't help unless it belongs to someone with access. /admin shows all three answers:
$ curl -i localhost:8000/admin
HTTP/1.1 401 Unauthorized
Server: rest-demo
Date: Mon, 30 Nov 2026 08:17:40 GMT
WWW-Authenticate: Bearer
Content-Type: application/json
Content-Length: 21
{"error":"no token"}
$ curl -i -H "Authorization: Bearer fake-123" localhost:8000/admin
HTTP/1.1 403 Forbidden
Server: rest-demo
Date: Mon, 30 Nov 2026 08:17:40 GMT
Content-Type: application/json
Content-Length: 24
{"error":"admins only"}
$ curl -i -H "Authorization: Bearer fake-admin" localhost:8000/admin
HTTP/1.1 200 OK
Server: rest-demo
Date: Mon, 30 Nov 2026 08:17:40 GMT
Content-Type: application/json
Content-Length: 12
{"users":5}
What bites. Leaking a token. Anything you type into curl lands in your shell history, and anything in a URL can end up in server logs. Keep tokens in headers, never in the query string, and keep real ones out of screenshots and shared terminals. The tokens on this page are fake on purpose.
Try it.
- Call
/mewith each token and with none. Which status does each one get? - Post a note with only the token, then only the JSON, then both. Which check does the server make first?
- Add
-vto one request and find the headers curl sent. They're the lines starting with>.
4. query params
When you reach for it. When you want part of a list, or the list in an order. Filtering, sorting, searching.
The idea. Everything after the ? is the query string: key=value pairs joined with &. The path still says which resource. The query string says how you want it. What each key does is up to the API, so check its docs. This server filters on any field, sorts with sort=, and sort=-name sorts backwards:
$ curl "localhost:8000/users?role=dev"
[{"id":1,"name":"Zoe","role":"dev"},{"id":3,"name":"Ana","role":"dev"},{"id":5,"name":"Mia","role":"dev"}]
$ curl "localhost:8000/users?role=dev&sort=name"
[{"id":3,"name":"Ana","role":"dev"},{"id":5,"name":"Mia","role":"dev"},{"id":1,"name":"Zoe","role":"dev"}]
$ curl "localhost:8000/users?sort=-name"
[{"id":1,"name":"Zoe","role":"dev"},{"id":5,"name":"Mia","role":"dev"},{"id":2,"name":"Kai","role":"pm"},{"id":4,"name":"Ben","role":"pm"},{"id":3,"name":"Ana","role":"dev"}]
$ curl -G localhost:8000/users -d role=pm -d sort=name
[{"id":4,"name":"Ben","role":"pm"},{"id":2,"name":"Kai","role":"pm"}]
$ curl "localhost:8000/users?sort=age"
{"error":"can't sort by age"}
-G with -d asks curl to build the query string for you and send a GET. -d passes values as they are, so for a value with spaces or symbols in it, like a search term, use --data-urlencode in place of -d and curl encodes it.
What bites. Not quoting the URL. In zsh, the default shell on a Mac, ? is a wildcard, so an unquoted URL never reaches curl. In bash, an unquoted & ends the command early. Put quotes around any URL with a ? in it. The other one is a typo in a key. This server reads rol=dev as a filter on a field nobody has and hands back an empty list, with a 200. Plenty of real APIs ignore keys they don't know and hand back everything instead. Either way, nothing tells you about the typo:
$ curl localhost:8000/users?role=dev
zsh: no matches found: localhost:8000/users?role=dev
$ curl "localhost:8000/users?rol=dev"
[]
Try it.
- List the pm users sorted by name, then the same list backwards.
- Combine a filter, a sort and a page in one URL.
- Ask for
sort=ageand read the error. Then add anageto every user with PATCH and try again.
5. pagination
When you reach for it. When a list is too long to send in one go. Most real APIs page their lists whether you ask or not.
The idea. limit says how many per page, page says which page. Page 1 with a limit of 2 is items 1 and 2, page 2 is items 3 and 4. You keep asking for the next page until one comes back empty, or shorter than the limit:
$ curl "localhost:8000/users?page=1&limit=2"
[{"id":1,"name":"Zoe","role":"dev"},{"id":2,"name":"Kai","role":"pm"}]
$ curl "localhost:8000/users?page=2&limit=2"
[{"id":3,"name":"Ana","role":"dev"},{"id":4,"name":"Ben","role":"pm"}]
$ curl "localhost:8000/users?page=3&limit=2"
[{"id":5,"name":"Mia","role":"dev"}]
$ curl "localhost:8000/users?page=4&limit=2"
[]
$ curl "localhost:8000/users?sort=name&page=1&limit=2"
[{"id":3,"name":"Ana","role":"dev"},{"id":4,"name":"Ben","role":"pm"}]
$ curl "localhost:8000/users?page=0&limit=2"
{"error":"page and limit must be whole numbers above 0"}
As a loop that walks every page:
$ page=1
while true; do
body=$(curl -s "localhost:8000/users?page=$page&limit=2")
[ "$body" = "[]" ] && break
echo "page $page: $body"
page=$((page + 1))
done
page 1: [{"id":1,"name":"Zoe","role":"dev"},{"id":2,"name":"Kai","role":"pm"}]
page 2: [{"id":3,"name":"Ana","role":"dev"},{"id":4,"name":"Ben","role":"pm"}]
page 3: [{"id":5,"name":"Mia","role":"dev"}]
It stopped by itself at page 4, the first empty one. The [ ... ] test compares the body with [], the empty list this server sends. Some APIs tell you there's more with a next link or a total count instead. Use that when there is one.
What bites. The list changing between pages. Here page 1 is read, then user 1 is deleted, then page 2 is read:
$ curl "localhost:8000/users?page=1&limit=2"
[{"id":1,"name":"Zoe","role":"dev"},{"id":2,"name":"Kai","role":"pm"}]
$ curl -X DELETE localhost:8000/users/1
$ curl "localhost:8000/users?page=2&limit=2"
[{"id":4,"name":"Ben","role":"pm"},{"id":5,"name":"Mia","role":"dev"}]
Ana (user 3) never showed up. Deleting user 1 moved everyone up one place, so Ana slid from page 2 onto page 1, which had already been read. A new user added near the front does the opposite and shows up twice. APIs that care about this use cursors instead of page numbers: each page says "carry on after id 2", so rows moving around don't matter. This server only does page numbers.
Try it.
- Walk the list with
limit=3, then withlimit=10. How many requests does each take? - Change the loop to stop when a page has fewer items than the limit. It saves a request.
- Add
?after=<id>to the server, returning the users with an id bigger than that, and walk the list with it while you delete users in between.
honest limitations
Five things isn't all of working with APIs. Getting a token in the first place (logins, API keys, OAuth), rate limits and the 429 that comes with them, versioning, caching and CORS all come up, and none of them are here.
The practice server is for practice. It keeps everything in memory, has no real login, speaks plain HTTP instead of HTTPS, and isn't safe to put on the internet.
What the query params mean is up to each API. sort=-name and page= and limit= are common, but plenty of APIs use order=, offset=, per_page= or a cursor instead. The docs are the only way to know.
The output is from curl 8.7.1. Older versions word some errors differently, and --json needs 7.82 or newer. On an older curl, use -H "Content-Type: application/json" -d '...' and add -X PUT or -X PATCH where you need them.
If you're building the other side of these requests, the system design cheat sheet covers caching and rate limiting, the linux commands cheat sheet covers the shell around curl, and the python cheat sheet covers the language the server is written in.