POST JSON body
Send JSON payload via POST
curl -X POST https://api.example.com/v1/items -H 'Content-Type: application/json' -d '{"name":"foo"}'
More curl commands
-
curl -H 'Authorization: Bearer $TOKEN' https://api.example.com/meAttach JWT/Bearer token in Authorization header
-
curl -Lv --max-redirs 5 https://example.comFollow up to 5 redirects and show full request/response
-
curl -sSL -o /tmp/result.json https://api.example.com/dataDownload silently, fail on error, follow redirects
-
curl -o /dev/null -sS -w 'ttfb: %{time_starttransfer}s\ntotal: %{time_total}s\n' https://example.comBenchmark TTFB and total request time
-
curl -sI https://example.comPrint HTTP response headers without body