cmda-bt / be-course-17-18

🎓 Backend · 2017-2018 · Curriculum and Syllabus 💾
Other
47 stars 19 forks source link

Transfer assignment #469

Closed Asprengers closed 6 years ago

Asprengers commented 6 years ago

Http cheatsheet

curl localhost:1901 - opens local host curl localhost:1901 --verbose - Returns info about the request head {"title":"Wonder Woman"} - add content

Methods

OPTIONS - To find out which ones are supported for a resource HEAD - HEAD is like GET but tells the server not to send any data back. GET - GET send data back from request POST - used to add something to a resource. PUT - used to place a resource somewhere, whether it exists already or not. PATCH - used to change only a few things DELETE - remove

Status codes

200 - Okay 201 - A success code for new resources 204 - No content

The status code in the 4xx range, means the client made an error.

400 - Bad Request 401 - The thing you wanted to do may be possible, but only if you are authorized to do so. 404 - Not found 405 - Method not allowed 410 - Means that there used to be something there, but it no longer exists. 422 - means that the request was valid, but there was something wrong with the data being sent to the server.

wooorm commented 6 years ago

Super nice Amy! 💪