Using cURL in a Bash Script: Get the Response Code from an API

Using the cURL command in a Bash script can be useful, but why?

We live in the era of APIs…

…you ask for data and you get it back…

But how can you know if your API request is successful?

HTTP response codes are able to tell you that, for example a successful request is identified…