Curl (https://curl.haxx.se/docs/httpscripting.html )
Note : space = %20
See the
Protocol $curl --trace-ascii debugdump.txt
http://www.example.com/
See the Timing $curl --trace-ascii d.txt
--trace-time http://example.com/
See the
Response -o or -O.
Host $curl --resolve
www.example.org:80:127.0.0.1 http://www.example.org/
Port number
$curl
http://www.example.org:1234/
$curl --proxy
http://proxy.example.org:4321 http://remote.example.org/
User name and
password $curl
-u user:password http://example.org/
GET $curl https://curl.haxx.se
ONLY the
headers (--head (-I))
Save file $ curl http://www.example.com -0 example.html
Multiple URLs
(get) $curl
http://url1.example.com http://url2.example.com
To send first
a HEAD and then a GET:$ curl
http://www.tutorialspoint.com -0 tutorialspoint.html
Redirect $ curl
www.tutorialspoint.com/unix/ --location
A GET-form
uses the method GET, as specified in HTML like:
<form method="GET"
action="junk.cgi">
<input type=text
name="birthyear">
<input type=submit name=press
value="OK">
</form>
$curl
"http://www.hotmail.com/when/junk.cgi?birthyear=1905&press=OK"
POST
<form
method="POST" action="junk.cgi">
<input type=text
name="birthyear">
<input type=submit name=press value="
OK ">
</form>
$curl --data
"birthyear=1905&press=%20OK%20"
http://www.example.com/when.cgi
$curl
--data-urlencode "name=I am Daniel" http://www.example.com
(replaces space with %20)
File Upload
POST
<form
method="POST" enctype='multipart/form-data'
action="upload.cgi">
<input type=file name=upload>
<input type=submit name=press
value="OK">
</form>
$curl --form
upload=@localfilename --form press=OK [URL]
Hidden Fields
<form
method="POST" action="foobar.cgi">
<input type=text
name="birthyear">
<input type=hidden name="person"
value="daniel">
<input type=submit name="press"
value="OK">
</form>
$curl --data
"birthyear=1905&press=OK&person=daniel" [URL]
send a POST
and then a GET:
$curl -d score=10 http://example.com/post.cgi
--next http://example.com/results.html
two POSTs $curl --data name=$curl http://url1.example.com http://url2.example.com
PUT $curl --upload-file
uploadfile http://www.example.com/receive.cgi
Basic
Authentication $curl --user name:password
http://www.example.com
Other
Authentication --ntlm, --digest, --negotiate
,--anyauth
Proxy
Authentication $curl --proxy-user proxyuser:proxypassword
$curl.haxx.se
No comments:
Post a Comment