Let’s get ready for some vocab 😄
Now what does this all look like in code?
Let’s find out! With a little help from a thing called cURL. The process will be very similar
Setup
command + space
and type in “terminal” and hit enter. If you are on Mac, something like this should pop up:Type in the command curl
and hit enter. You should see:
If you don’t, and feel confident with installing command line tools on your machine, follow the steps here: https://github.com/curl/curl. I would recommend adding curl to your path env variables! If not, you can use https://onlinecurl.com/ for now :) Otherwise, ask a TA or the Instructors!
Using Curl
curl --help
to see what types of commands are at your fingertips.Let’s try a basic command:
curl <https://www.keycdn.com/support/popular-curl-examples
>curl -X GET <https://www.keycdn.com/support/popular-curl-examples
> in your terminalcurl -I <https://www.keycdn.com/
>curl -X [Request Method] [URL]
(do not include the brackets)More complex requests
curl -X POST <https://www.keycdn.com/support/popular-curl-examples
>Let's update our template for cURL requests:
curl -X [Request Method] [URL] -d [data string]
param1=this is param 1¶m2=this is param2
You are free to go after if you would like. We will be helping out people with setup questions.