Skip to content

Instantly share code, notes, and snippets.

@theking2
Created February 5, 2024 19:30
Show Gist options
  • Save theking2/c31ba732ccc7c8bc8bc08b037d40c4f3 to your computer and use it in GitHub Desktop.
Save theking2/c31ba732ccc7c8bc8bc08b037d40c4f3 to your computer and use it in GitHub Desktop.
HTTP - Responses Methods
| method | response code | reason |
| - | - | - |
| * | 500 | internal error, the request is not processd, the response paylood might include more detail |
| * | 502 | request validated but upstream service were not available. Request was not fullfilled|
| * | 405 | request not validated or allowed |
| * | 403 | the request validated but was not allwowed, reason in payload |
| HEAD | 200 | success |
| POST | 201 | rsourcce created,payload contains the id and a identifying url |
| POST | 303 | resource is availabel unique url|
| GET | 200 | success body contains represenation of a single or multiple resources |
| GET | 204 | success but empty result |
| GET | 404 | an identified resource was not or no longer available |
| PUT | 200 | success, the resource was updated. attributes not mentioned are removed |
| PUT | 404 | resource identified was not or no longer available |
| DELETE | 200 | resource is destroyed |
| DELETE | 202 | reousrce will be destroyed|
| PWTCH | 200 | success, the resource was updated, only mentions attributess are updated |
| PATCH | 404 | resource identified was not or no longer available |
| OPTIONS| 200 | include valid methods and |
| OPTIONS| 404 | resource unavailabl |
See (RFC7231)[https://www.rfc-editor.org/rfc/rfc7231] for details.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment