Tuesday, October 25, 2011

curl simulate HTTP POST

in windows I use following command
curl http://172.19.xx.xxx/XmlConfig -u guest:password -d@cmd.txt -basic -v -L -c c.txt
-u for username and password
-d@ read HTTP message body from cmd.txt file
-basic: BASIC Authentication
-v: verbose output
-L : auto follow redirect
-c:save and load cookie from c.txt,and auto manage session by cookie

in linux:
curl http://172.19.xxx.xxx/XmlConfig -u guest:password -d '' -basic -v -L -c c.txt

this one I put the HTTP message body in command like directly


when curl output it will print curl message started with star(*), the data been send with by curl "<",data received with "<".

No comments:

Post a Comment