HTTP Codes Flashcards
HTTP Response Status Codes (21 cards)
100-199
Informational
200-299
Successful
300-399
Redirection
400-499
Client error
500-599
Server error
200
OK
Everything worked as expected.
Seen on successful GET, POST, PUT, DELETE requests.
201
Created
The server created a resource (commonly after POST).
204
No Content
The request succeeded, but no response body is returned (often after DELETE or a successful update with no content to return).
301
Moved Permanently
The URL of the requested resource has been changed permanently. The new URL is given in the response.
302
Found
Temporary redirect; often shows up when testing login flows.
304
Not Modified
Browser caching: tells the client to use its cached version.
401
Unauthorized
Although the HTTP standard specifies “unauthorized”, semantically this response means “unauthenticated”. That is, the client must authenticate itself to get the requested response.
400
Bad Request
The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).
403
Forbidden
The user is authenticated but not allowed to access the resource.
409
Conflict
Happens when a request conflicts with the current state of the server (e.g., duplicate unique fields)
404
Not Found
The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web.
422
Unprocessable Entity
Often from validation failures, especially in RESTful APIs.
500
Internal Server Error
The server has encountered a situation it does not know how to handle. This error is generic, indicating that the server cannot find a more appropriate 5XX status code to respond with.
502
Bad Gateway
This error response means that the server, while working as a gateway to get a response needed to handle the request, got an invalid response.
503
Service Unavailable
The server is not ready to handle the request. Common causes are a server that is down for maintenance or that is overloaded. Note that together with this response, a user-friendly page explaining the problem should be sent. These temporary condition responses should usually not be cached.
504
Gateway Timeout
This error response is given when the server is acting as a gateway and cannot get a response in time.