Commands.app

curl

Networking

Transfer data from or to a server using various protocols

Options & Flags
Available options for this command
-X METHOD

Specify request method (GET, POST, PUT, DELETE, etc.)

-H 'Header'

Add custom header to request

-d 'data'

Send data in POST request

-o file

Write output to file instead of stdout

-I

Fetch headers only

Examples
Common usage examples

Make a GET request to API

curl https://api.example.com

Make a POST request with JSON data

curl -X POST -H 'Content-Type: application/json' -d '{"key":"value"}' https://api.example.com

Fetch only HTTP headers

curl -I https://example.com
Notes
  • Supports HTTP, HTTPS, FTP, and many other protocols
  • Use -v for verbose output to debug requests
Related Commands
You might also find these useful