HTTP Codes Flashcards

(6 cards)

1
Q

2xx Codes

A

Code Meaning Typical Use
200 OK Request successful GET, PUT, PATCH, DELETE
201 Created Resource created POST
202 Accepted Accepted for processing (async) POST, PUT
204 No Content Success, no response body DELETE, PUT

GET /orders/123 → 200 OK

POST /orders → 201 Created

DELETE /orders/123 → 204 No Content

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

3xx Code

A

301 Moved Permanently Permanent redirect URL changes
302 Found Temporary redirect Short-term routing
304 Not Modified Cached response still valid GET with caching

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

4xx

A

Code Meaning Typical Scenario
400 Bad Request Invalid request format JSON validation fails
401 Unauthorized Not authenticated Missing/invalid token
403 Forbidden Not allowed Role-based access
404 Not Found Resource not found Wrong ID
405 Method Not Allowed Verb not supported POST on read-only endpoint
429 Too Many Requests
Rate limit exceeded
API throttling

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

5xx

A

500 Internal Server Error Generic server failure Unhandled exception
502 Bad Gateway Invalid upstream response API Gateway issue
503 Service Unavailable Service down Maintenance
504 Gateway Timeout Upstream timeout Slow dependency

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Code and Verbs

A

HTTP status codes are independent of HTTP verbs, but REST conventions define how they should be used together.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

304 code

A

“The resource hasn’t changed since the last time you fetched it—use your cached copy.”
Client already has a cached response
Client asks: “Has this changed?”
Server says: “No” (304)
No response body is sent

How well did you know this?
1
Not at all
2
3
4
5
Perfectly