-
Get a html content from an url
curl http://www.exmaple.com
-
-o
Get a html content and save it to a filecurl -o example.html http://www.exmaple.com
-
-x
Using Proxycurl -x 123.45.67.89:1080 -o example.html http://www.exmaple.com
-
-D
Dump a cookiecurl -x 123.45.67.89:1080 -o example.html -D cookie0001.txt http://www.exmaple.com
-
-b
Add cookie to http headercurl -x 123.45.67.89:1080 -o page1.html -D cookie0002.txt -b cookie0001.txt http://www.linuxidc.com
-
-H
Add a value to http headercurl -H "key: value" www.example.com
-
-O
Save a file from server with a same namecurl -O http://cgi2.tky.3web.ne.jp/~zzh/screen1.JPG
-
Usign Regular Expression to make a matched file name changes its name
curl -O http://cgi2.tky.3web.ne.jp/~zzh/screen[1-10].JPG curl -o #2-#1.jpg http://cgi2.tky.3web.ne.jp/~{zzh,nick}/[001-201].JPG
Original: ~zzh/001.JPG -> After downloaded:001-zzh.JPG Original: ~nick/001.JPG -> After downloaded:001-nick.JPG
-
-u
Setting FTP username and passwordcurl -u name:passwd ftp://ip:port/path/file curl ftp://name:passwd@ip:port/path/file
-
-T
Upload a filecurl -T localfile -u name:passwd ftp://upload_site:port/path/ curl -T localfile http://cgi2.tky.3web.ne.jp/~zzh/abc.cgi
-
GET
Request GET REQUESTcurl http://www.linuxidc.com/login.cgi?user=nickwolfe&password=12345
-
POST
Request POST REQUESTcurl -d "user=nickwolfe&password=12345" http://www.linuxidc.com/login.cgi
An example that is used to post a form to server. Besides upload a file.
<form action="http://cgi2.tky.3web.ne.jp/~zzh/up_file.cgi" enctype="multipar/form-data" method="POST"> <input name="upload" type="file"/> <input name="nick" type="submit" value="go"/></form>
-F
For a form request, we have to do socurl -F upload=@localfile -F nick=go http://cgi2.tky.3web.ne.jp/~zzh/up_file.cgi
-
https local certificate
curl -E localcert.pem https://remote_server
Created
July 22, 2013 09:09
-
-
Save nextsummer33/6052463 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment