Site Tools


This is an old revision of the document!


curl

  • -O, –remote-name: save the file with remote filename
  • -o, –no-remote-name: save the file as the name provided
  • -L, –location: follow 3xx redirect
  • -#, –progress-bar: show download progress
  • –request, -X: specify request method
  • -F, –form: multipart post
  • -f, –fail: Fail silently (no output at all) on server errors. This is mostly done to enable scripts etc to better deal with failed attempts.

automatically find out where/how to resume the transfer

curl -O -C -

post body from pipe

cat file.json | curl --request POST https://httpbin.org/post --data-binary @-

post form data

curl --request POST https://httpbin.org/post -F X=1

upload a file

curl -X POST https://httpbin.org/post -F 'file=@filename.txt'
cli/curl.1622422383.txt.gz · Last modified: by dcai