get web page source code:


get and save this web page:

curl -o google.html

this is the same as wget.

some domain will auto redirect, for example, will redirect to if you are in nz. To allow auto redirect:

curl -L

show header info with web page source code:

curl -i

header only:

curl -I

show connection steps:

curl -v

even more info:

curl --trace output.txt

the above one will show hex data, to show ascii only:

curl --trace-ascii output.txt

send get data:


send post data:

curl -X POST --data "data=xxx"

the default method is GET, use -X to specify other ones:

curl -X DELETE