cmda-bt / be-course-17-18

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

Transfer assignment #512

Closed matsfeber closed 6 years ago

matsfeber commented 6 years ago

HTTP cheat-sheet

curl : A method to show your get request in the terminal curl —verbose : Also shows headings

Methodes :

GET : Retrieve data, head and body.

HEAD : Retrieve data, this only retrieves,like it says, the heading.

POST : Add something to a resource. For example you can add sugar to a list of ingredients.

PUT : Also adds something to a resource, but overwrites the resource.

DELETE : Delete a specified resource.

PATCH : Apply modifications.

Mime :

There are 5 main mime types :

  1. Text
  2. Image
  3. Audio
  4. Video
  5. Application

There also are a lot of subtypes for example. text/html and image/png

Mime types allows files to be read the right way, you use it like this:

var mime = {
  '.html': 'text/html',
  '.css': 'text/css',
  '.png': 'image/png',
}

Status :

1 .1xx range : Informational responses 2 .2xx range : Success 3 .3xx range : Redirection

  1. 4xx range : Client errors
  2. 5xx range : Server errors
rijkvanzanten commented 6 years ago

Good job! 🎉