cURLing basics ;)

cURL is a command line tool that allows you to get or send data with URLs. You can read all about it at its official site https://curl.haxx.se/

Here are some basic ways to use the cURL command –

(1) Check the connection

You can check whether you’re able to connect to a given URL by simply typing in curl followed by the url. For example: curl google.com.

If for some reason you can’t connect, it’ll return a few errors and you can use those to troubleshoot the issue further.

(2) Save the content

You could save the website content to a file by typing in curl https://your-site.com > your-site.html.

(3) See the headers

This is the cool part. You could see request/reponse headers for a given URL by typing in curl -v your-site.com. For example curl -v google.com returns the following results to me:

Pretty cool, right? I’ll keep this post short with those 3 points. To learn more about the cURL command please checkout the official site linked above 🙂