cURL / Mailing Lists / curl-users / Single Mail

curl-users

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

From: Babu, Ramesh (LBD) <Ramesh.Babu_at_lombardvm.com>
Date: Wed, 17 Oct 2007 09:20:07 +0100

If URL is
http://www.formpost.com/getthis/post.cgi?user=foobar&pass=12345&id=blabl
abla&ding=submit

Curl command to POST the above url is as follows,

curl -d "user=foobar&pass=12345&id=blablabla&ding=submit" (continues)
          http://www.formpost.com/getthis/post.cgi

Name and value pairs separeated by & in the URL like user=foobar should
be mentioned in -d option in CURL. Try the above example. I hope it
solves your problem.

Regards,
Ramesh Babu

-----Original Message-----
From: curl-users-bounces_at_cool.haxx.se
[mailto:curl-users-bounces_at_cool.haxx.se] On Behalf Of ??
Sent: Wednesday, October 17, 2007 8:11 AM
To: curl-users_at_cool.haxx.se
Subject: How to POST by curl command line tool as follws...

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/ex
ec/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_defau
lt.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/e
xec/BlogBean.addComment.dwr "
 
 
-sincerely SCH-
*** WARNING : This message originates from the Internet ***
The opinions expressed in this email represent those of the individual
and not necessarily those of Lombard Vehicle Management Limited.
The contents of this email may be privileged and are confidential.
It may not be disclosed to or used by anyone other than the
addressee(s), nor copied in any way. If received in error, please
advise the sender, then delete from your system.
Should you wish to use email as a mode of communication,
Lombard Vehicle Management Limited is unable to guarantee the security
of email content outside our own computer systems.
Lombard Vehicle Management Limited
Registered in England. No 2597082
Registered Office: 3 Princess Way, Redhill, Surrey, RH1 1NP
A member of the Royal Bank of Scotland Group.
Lombard Vehicle Management Limited is an appointed representative of The Royal Bank of Scotland plc, which is authorised and regulated by the Financial Services Authority
Received on 2007-10-17