Ограничить скорость загрузки curl
Ограничить скорость загрузки до 1 МБ/с
curl --limit-rate 1M -O https://example.com/bigfile.iso
more curl
all 21 commands →
POST JSON данные
curl -s -X POST https://api.example.com/v1/resource -H 'Content-Type: application/json' -H 'Authorization: Bearer <token>' -d '{"key":"value"}' | jq .
Следовать редиректам с 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 .