Closed Sam-Guliker closed 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?
@Sam-Guliker Ping!
Oh oops, will make this tonight
Pinggg!
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"}'
curl localhost:1901 -v --request POST --data {"title":"Wonder Woman"}
With get you can GET
the content via a request
curl localhost:1901/wonder-woman -v request GET
UPDATE
gives you the opportunity to update the data.
curl localhost:1901/wonder-woman -v --request PATCH --data '{"description":"Diana leaves home to fight a war."}'
DELETE ALL THE THINGS
just kidding, maybe :thinking:
curl localhost:1901 /wonder-woman -v --request DELETE
Use verbose
to get more information
--verbose
Separates options
from the next
curl localhost:1901/wonder-woman -v --request OPTIONS
Types of Data
curl localhost:1901 -v --request GET --header 'Accept: application/xml'
curl localhost:1901 -v --request --header 'Accept-Encoding: application/gzip'
Getting access to delete somthing.
curl localhost:1901/evil-dead -v --request DELETE --header 'Authorization: token+put-your-token-here+'
leuk om met command-line te spelen ๐