Запрос с Basic Auth curl
HTTP запрос с Basic Authentication
curl -s -u user:password https://api.example.com/endpoint | jq .
more curl
all 21 commands →
Только HTTP статус код
curl -so /dev/null -w '%{http_code}' https://example.com
POST с JSON телом
curl -X POST https://api.example.com/v1/items -H 'Content-Type: application/json' -d '{"name":"foo"}'
Авторизация Bearer токеном
curl -H 'Authorization: Bearer $TOKEN' https://api.example.com/me
Следовать редиректам подробно
curl -Lv --max-redirs 5 https://example.com
Сохранить ответ в файл
curl -sSL -o /tmp/result.json https://api.example.com/data