Category Archives: SHELL

CURL help

curl     -A  ‘Mozilla/5.0 (Windows NT 6.1; Trident/7.0; rv:11.0) like Gecko’  -o page1.html      -D cookie1.txt  http://it-ebooks.info/book/6616/

curl -e http://it-ebooks.info/book/6616/ -A  ‘Mozilla/5.0 (Windows NT 6.1; Trident/7.0; rv:11.0) like Gecko’  -o page2.html -D cookie2.txt -b cookie1.txt  http://filepi.com/i/yOKFHab

get request(urlencode) :

curl -s -k –data-urlencode {message}@C:/requestbody.xml -o C:/responsebody.xml  {mainUrl}

post request(use anyauth):

curl -s  –anyauth -u {username}:{password} –data-urlencode {parm1name}={parm1value} –data-urlencode {parm2name}={parm2value}  -o C:/responsebody.xml  {mainUrl}

post request(file upload) :

curl -s -k -s  –anyauth -u {username}:{password} -A {useragent} -F {parm1name}={parm1value} -F {parm2name}={parm2value} -F file_1=@IMG_0001.JPG -o C:/responsebody.xml  {mainUrl}
Digest认证(use header)
curl -s  –header   Authorization:’Digest username={username}’ –data-urlencode {parm1name}={parm1value} –data-urlencode {parm2name}={parm2value}  -o C:/responsebody.xml  {mainUrl}
curl -s -k -s  –header   Authorization:’Digest username={username}’ -A {useragent} -F {parm1name}={parm1value} -F {parm2name}={parm2value} -F file_1=@IMG_0001.JPG -o C:/responsebody.xml  {mainUrl}

 

NAME

curl – transfer a URL

SYNOPSIS

curl [options] [URL…]

DESCRIPTION

curl is a tool to transfer data from or to a server, using one of the supported protocols (DICT, FILE, FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET and TFTP). The command is designed to work without user interaction.

curl offers a busload of useful tricks like proxy support, user authentication, FTP upload, HTTP post, SSL connections, cookies, file transfer resume, Metalink, and more. As you will see below, the number of features will make your head spin!

curl is powered by libcurl for all transfer-related features. See libcurl(3) for details.

refer : http://curl.haxx.se/docs/manpage.html

Using curl to automate HTTP jobs