Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision |
| cli:curl [2021-05-31] – created dcai | cli:curl [2021-05-31] (current) – dcai |
|---|
| |
| |
| * ''-O'': save the file with remote filename | * ''-O, --remote-name'': save the file with remote filename |
| * ''-o'': save the file as the name provided | * ''-o, --no-remote-name'': save the file as the name provided |
| * ''-L'': follow 3xx redirect | * ''-L, --location'': follow 3xx redirect |
| * ''-#'' or ''--progress-bar'': show download progress | * ''-#, --progress-bar'': show download progress |
| | * ''-X, --request'': 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. |
| | * ''-k, --insecure'': ignore SSL certificate |
| | |
| | ==== automatically find out where/how to resume the transfer ==== |
| | <code>curl -O -C -</code> |
| | |
| | ==== post body from pipe ==== |
| | <code> |
| | cat file.json | curl --request POST https://httpbin.org/post --data-binary @- |
| | </code> |
| | |
| | ==== post form data ==== |
| | <code> |
| | curl --request POST https://httpbin.org/post -F X=1 |
| | </code> |
| | |
| | |
| | ==== upload a file ==== |
| | <code> |
| | curl -X POST https://httpbin.org/post -F 'file=@filename.txt' |
| | </code> |