POST JSON данные curl
Отправить JSON POST запрос с Bearer токеном
curl -s -X POST https://api.example.com/v1/resource -H 'Content-Type: application/json' -H 'Authorization: Bearer <token>' -d '{"key":"value"}' | jq .
more curl
all 21 commands →
Следовать редиректам с verbose
curl -sLv https://example.com 2>&1 | grep -E '^[<>*]'
Замерить время запроса
curl -so /dev/null -w 'DNS: %{time_namelookup}s\nConnect: %{time_connect}s\nTTFB: %{time_starttransfer}s\nTotal: %{time_total}s\n' https://example.com
Скачать с прогрессом
curl -L --progress-bar -o output.file https://example.com/file.tar.gz
Запрос с Basic Auth
curl -s -u user:password https://api.example.com/endpoint | jq .
Только HTTP статус код
curl -so /dev/null -w '%{http_code}' https://example.com