curl

Updated: 26 October 2025

Write output to file instead of stdout

curl http://some.url --output <file>

Basic HTTP server authorisation

curl -u user:pass http://some.url
# or
curl http://user:pass@some.url

Make the operation more talkative

curl --verbose https://www.google.com

By default, every secure connection curl makes is verified to be secure before the transfer takes place. The --insecure option makes curl skip the verification step and proceed without checking.

curl --insecure https://www.example.com

Follow redirects

curl --location https://www.i-have-moved.com

Pretty print json response by piping through jq command

curl --insecure -X 'POST' \
    'https://localhost/authors' \
    -H 'accept: application/ld+json' \
    -H 'Content-Type: application/ld+json' \
    -d '{
  "Name": "string",
  "email": "string",
  "website": "string",
  "Twitter": "string"
}' | jq