curl
NetworkingTransfer data from or to a server using various protocols
Options & Flags
Available options for this command
-X METHODSpecify request method (GET, POST, PUT, DELETE, etc.)
-H 'Header'Add custom header to request
-d 'data'Send data in POST request
-o fileWrite output to file instead of stdout
-IFetch headers only
Examples
Common usage examples
Make a GET request to API
curl https://api.example.comMake a POST request with JSON data
curl -X POST -H 'Content-Type: application/json' -d '{"key":"value"}' https://api.example.comFetch only HTTP headers
curl -I https://example.comNotes
- Supports HTTP, HTTPS, FTP, and many other protocols
- Use -v for verbose output to debug requests