curl commands
Updated 2026-02-15
curl flags for HTTP requests: GET, POST, headers, auth, and file upload. Debug APIs from the terminal.
Basic requests
curl https://api.example.comGET request.
curl -X POST -d '{"a":1}' -H 'Content-Type: application/json' URLPOST JSON.
curl -X PUT -d @file.json URLPUT with file body.
curl -X DELETE URLDELETE request.
Headers and auth
curl -H 'Header: value' URLAdd header.
curl -u user:pass URLBasic auth.
curl -H 'Authorization: Bearer TOKEN' URLBearer token.
curl -v URLVerbose output.
curl -i URLInclude response headers.
Files and redirect
curl -o file URLSave to file.
curl -L URLFollow redirects.
curl -F 'file=@path' URLMultipart form upload.