Site Tools


This is an old revision of the document!


curl

  • -O: save the file with remote filename
  • -o: save the file as the name provided
  • -L: follow 3xx redirect
  • -# or –progress-bar: show download progress
  • –request or -X: specify request method

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 -d X=1

upload a file

curl --request POST https://httpbin.org/post -d 'file=@filename.txt'
cli/curl.1622421230.txt.gz · Last modified: by dcai