curl -D headers.txt -o response.json https://api.example.com

Category: Web App Development

curl -D headers.txt -o response.json https://api.example.com

Save response headers and body to separate files

Writes the response headers to headers.txt with -D and the body to response.json with -o. Splitting them makes it easy to inspect status, cookies and rate-limit headers without burying them in the payload. Add -s to suppress progress noise.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.