cmda-bt / be-course-17-18

๐ŸŽ“ Backend ยท 2017-2018 ยท Curriculum and Syllabus ๐Ÿ’พ
Other
47 stars 19 forks source link

Transfer assignment #464

Closed Sam-Guliker closed 6 years ago

Sam-Guliker commented 6 years ago
screen shot 2018-02-28 at 14 30 41

leuk om met command-line te spelen ๐Ÿ˜„

wooorm commented 6 years ago

Super awesome that you finished it! In the assignment, I asked for an HTTP cheat sheet:

If you completed the tutorial, mark this assignment as complete by opening an issue on our GitHub issue tracker. In your issue, show us a cheat sheet you made of HTTP and how it works.

Could you post that below?

wooorm commented 6 years ago

@Sam-Guliker Ping!

Sam-Guliker commented 6 years ago

Oh oops, will make this tonight

wooorm commented 6 years ago

Pinggg!

Sam-Guliker commented 6 years ago

Cheats

Methods

PUT

You can send data via PUT and POST. With PUT or POST you can create objects into the data and give them keys and values

curl localhost:1901/wonder-woman -v --request PUT --data '{"title":"Wonder Woman","plot":"Diana fights a war"}'

POST

curl localhost:1901 -v --request POST --data {"title":"Wonder Woman"}

GET

With get you can GET the content via a request

curl localhost:1901/wonder-woman -v request GET

UPDATE

UPDATE gives you the opportunity to update the data.

PATCH

curl localhost:1901/wonder-woman -v --request PATCH --data '{"description":"Diana leaves home to fight a war."}'

DELETE

DELETE ALL THE THINGS just kidding, maybe :thinking:

curl localhost:1901 /wonder-woman -v --request DELETE

OTHER

VERBOSE

Use verbose to get more information

--verbose

OPTIONS

Separates options from the next

curl localhost:1901/wonder-woman -v --request OPTIONS

XML, HTML or CSV

Types of Data

curl localhost:1901 -v --request GET --header 'Accept: application/xml'
curl localhost:1901 -v --request --header 'Accept-Encoding: application/gzip'

Authorization

Getting access to delete somthing.

curl localhost:1901/evil-dead -v --request DELETE --header 'Authorization: token+put-your-token-here+'