With cURL, you can make HTTP requests to APIs, backends, or simply URLs from the command line.
The basic commands are:
curl https://v2.jokeapi.dev/joke/programming
- make a simple GET requestcurl google.com -L
- short for--location
returns the response after any redirectscurl https://reqres.in/api/users -d "page=2"
- short for--data
adds data parameterscurl https://reqres.in/api/users -X POST
- short for--request
defines the HTTP method to use; in this case itβsPOST
curl https://reqres.in/api/users -H 'Key: Value'
- short for--header
sets an additional key-value pair in the header