Using RESTful APIs via cURL
cURL is a command-line utility to transfer data using various protocols, including HTTP and HTTPS. cURL is widely used to try RESTful APIs using its command-line interface. For example, let's take a look at the APIs provided by MetaWeather (https://www.metaweather.com/api/) to query a location and get its weather information. Since it is a public API that maintains the weather information of well-known places, it allows only GET requests to get the details of the resources and does not allow creating or updating resources.
To get the weather of a location, the MetaWeather application requires the resource ID as defined by the system. To get the resource ID, MetaWeather provides a search API to look up the resources ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access