Notes on RESTful API Design
This is a list of return codes in relation to a RESTful API design.
Some of the operations has more that one outcome, so you need to decide on what you find the most appropriate one.
Operation | HTTP Method | STATUS CODE ON SUCCESS |
---|---|---|
Create | POST | 201 Created |
202 Accepted | ||
Read | GET | </td>200 OK |
Update | PUT | 200 OK |
204 No Content | ||
PATCH | 200 OK | |
204 No Content | ||
Delete | DELETE | 200 OK |
202 Accepted | ||
204 No Content |
Operation | HTTP Method | STATUS CODE ON ERROR |
---|---|---|
Create | POST | 409 Conflict |
422 Unprocessable Content | ||
Read | GET | </td>404 Not Found |
Update | PUT | 404 Not Found |
409 Conflict | ||
PATCH | 404 Not Found | |
Delete | DELETE | 404 Not Found |