-
Get a html content from an url
curl http://www.exmaple.com -
-oGet a html content and save it to a filecurl -o example.html http://www.exmaple.com -
-xUsing Proxycurl -x 123.45.67.89:1080 -o example.html http://www.exmaple.com -
-DDump a cookiecurl -x 123.45.67.89:1080 -o example.html -D cookie0001.txt http://www.exmaple.com -
-bAdd cookie to http headercurl -x 123.45.67.89:1080 -o page1.html -D cookie0002.txt -b cookie0001.txt http://www.linuxidc.com -
-HAdd a value to http headercurl -H "key: value" www.example.com -
-OSave 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].JPGOriginal: ~zzh/001.JPG -> After downloaded:001-zzh.JPG Original: ~nick/001.JPG -> After downloaded:001-nick.JPG
-
-uSetting FTP username and passwordcurl -u name:passwd ftp://ip:port/path/file curl ftp://name:passwd@ip:port/path/file -
-TUpload a filecurl -T localfile -u name:passwd ftp://upload_site:port/path/ curl -T localfile http://cgi2.tky.3web.ne.jp/~zzh/abc.cgi -
GETRequest GET REQUESTcurl http://www.linuxidc.com/login.cgi?user=nickwolfe&password=12345 -
POSTRequest POST REQUESTcurl -d "user=nickwolfe&password=12345" http://www.linuxidc.com/login.cgiAn 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>-FFor 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