Back to Cheat SheetsAPI · Beginner
REST API cheat sheet
Methods, headers, auth and the design rules you assert against.
Methods
GET
Safe and idempotent
GET /users?page=2POST
Creates, not idempotent
POST /usersPUT vs PATCH
Both idempotent when designed correctly
PUT = full replace, PATCH = partial updateDELETE
Idempotent — repeat returns 404 or 204
DELETE /users/42Headers and auth
Content type
Content-Type: application/jsonBearer token
Authorization: Bearer <jwt>API key
x-api-key: <key>Idempotency
Common on payment APIs
Idempotency-Key: <uuid>What to assert
Status + schema
expect(res.status).toBe(201); validate(res.body, schema);Negative cases
missing field → 400, bad token → 401, wrong owner → 403Go beyond the reference
Book a free demo class and apply these commands on live project work.