curl -X GET 34.237.137.145
curl -X POST 34.237.137.145
curl -X POST 34.237.137.145 -H 'content-type: application/json' -d '{"body": "hello"}'
curl -X POST 34.237.137.145 -H 'content-type: application/json' -d '{"firstName": "Paul", "lastName": "Matthews"}'
curl -X POST 35.153.156.170/todos -H 'content-type: application/json' -d '{"text": "buy milk"}'
/todos
. What has changed?Try to add a task for walking the dog?
curl -X POST 35.153.156.170/todos -H 'content-type: application/json' -d '{"task": "walk dog"}'
What did we do wrong?
curl -X POST 35.153.156.170/todos -H 'content-type: application/json' -d '{"text": "walk dog"}'
/todos
to see what has changedSay we completed one of our tasks. We can update it’s completed field by sending a PATCH request:
curl -X PATCH 35.153.156.170/todos/2
/todos
. What has changed?Say we want to remove the task we completed. We can remove it from the list by sending a DELETE request:
curl -X DELETE 35.153.156.170/todos/2
/todos
. What has changed?curl
allows us to make HTTP requests from our terminalcurl
allows us to set the HTTP method to: GET, POST, PATCH, DELETE and morecurl
the HTTP responses is printed to STDOUTman curl
and curl --help
are two ways to learn more about curl from the terminal