Prompt
How can I quickly test an API endpoint from the terminal?
Latest observation
Oct 6, 2026
OpenAI APIWeb search: off
The quickest way is usually curl.
Basic examples
GET request
curl https://api.example.com/users
GET with query params
curl "https://api.example.com/users?id=123&active=true"
POST JSON
curl -X POST https://api.example.com/users \
-H "Content-Type: application/json" \
-d '{"name":"Alice","email":"alice@example.com"}'
With an API key / bearer token
curl https://api.example.com/profile \
-H "Authorization: Bearer YOUR_TOKEN"
Show response headers
curl -i https://api.example.com/users
Pretty-print JSON
If you have jq installed:
curl -s https://api.example.com/users | jq
Handy options
-Xset HTTP method-Hadd headers-dsend data-iinclude response headers-ssilent mode-vverbose/debug-Lfollow redirects
Alternative tools
- HTTPie: more readable than curl
http GET https://api.example.com/users - Postman/Newman for more involved testing
If you want, I can give you a one-line curl command for your specific endpoint.