cURL / Mailing Lists / curl-users / Single Mail

curl-users

How to POST by curl command line tool as follws...

From: C <schawk_at_ms7.hinet.net>
Date: Wed, 17 Oct 2007 15:11:26 +0800

Dear sir:

I found what IE post by httplook as follws...
And my question is how to POST by curl command line tool as follws?
I write my answer at last, is it right?



--------------------------------------------------------------------------------

POST http://demi.zhao.blog.163.com/blog/static/38118965200791333615774/dwr/exec/BlogBean.addComment.dwr HTTP/1.0
Accept: */*
Content-Type: text/plain
Referer: http://demi.zhao.blog.163.com/blog/static/38118965200791333615774/
Proxy-Connection: Keep-Alive
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)
Host: demi.zhao.blog.163.com
Content-Length: 1048
Pragma: no-cache
Cookie: NTESBLOGSI=83E2A214547975F3AB35F39C85B67BB3.app-27

callCount=1
c0-e1=string:_fks_Rewn0KT0OncJrP8BRLNl9485efthha7q
c0-e2=string:0
c0-e3=string:
c0-e4=string:good%26nbsp%3Bluck%26nbsp%3B%E7%BB%99%E6%82%A8
c0-e5=Date:1192593897843
c0-e6=string:%E7%BD%91%E6%98%93%E5%8D%9A%E5%8F%8B13
c0-e7=string:139.223.67.48%2C%20139.223.11.13
c0-e8=string:
c0-e9=string:
c0-e10=string:http%3A%2F%2Fst.blog.163.com%2Fstyle%2Fcommon%2Fuser_default.gif
c0-e11=string:_fks_Rewn0KT0OncJrP8BRLNl9485efthha7q
c0-e12=number:38118965
c0-e13=string:2007%E5%B9%B410%E6%9C%8813%E6%97%A5
c0-param0=Object:{parentId:reference:c0-e1, publisherId:reference:c0-e2, publisherName:reference:c0-e3, content:reference:c0-e4, publishTime:reference:c0-e5, publisherNickname:reference:c0-e6, ip:reference:c0-e7, publisherEmail:reference:c0-e8, publisherUrl:reference:c0-e9, publisherAvatarUrl:reference:c0-e10, blogId:reference:c0-e11, blogUserId:reference:c0-e12, blogTitle:reference:c0-e13}
c0-param1=number:0
c0-param2=string:6487
c0-param3=boolean:false
c0-scriptName=BlogBean
c0-methodName=addComment
c0-id=2126_1192593897843
xml=true

--------------------------------------------------------------------------------


I write all text line break by line break to the file "C:\all.txt" and my command line is like this:

curl -e "http://demi.zhao.blog.163.com/blog/static/38118965200791333615774/" -d "@C:\all.txt" "http://demi.zhao.blog.163.com/blog/static/38118965200791333615774/dwr/exec/BlogBean.addComment.dwr "


-sincerely SCH-
Received on 2007-10-17