sending HTTP POST using curl command
September 15th, 2007 mysurface Posted in curl, Network | Hits: 453570 | 23 Comments »
Recently I was having fun with libcurl, discovered that with curl command I capable of doing HTTP POST with specified User-agent string. For those who have no idea what is curl, curl is a powerful client tool for accessing servers through FTP, FTPS, HTTP, HTTPS, SCP, SFTP, TFTP, TELNET, DICT, FILE and LDAP, please find more info from cURL official site.
Mypapit has written a good post illustrate how to create a simple bot script using php with curl bindings. By calling curl function in php, you can do a HTTP POST to a web server’s page. Well, with curl command in bash, you can do the same, and it consist of just one line.
Mypapit is kind enough to provide his HTTP POST server’s script in php for testing purpose. Download his sample codes and load it to your apache server and you can try out the command lines shows later. What you need is target.php and target.txt, remember to chmod a+w target.txt.
To send HTTP POST request, you can do it with -F, I show you a simple example that sending username to the web server.
curl -F 'username=mysurface' http://127.0.0.1/target.php
And result returns
data was submitted successfully
Check out the target.txt, gives the line
username : mysurface (curl/7.15.5 (i486-pc-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8c zlib/1.2.3 libidn/0.6.5)
p.s mypapit’s target.php logs submitted username and it’s user-agent into file target.txt. The result showing above indicates that the submission was done by curl.
Well, you can override the default user-agent string by -A
curl -F 'username=mysurface' -A 'Mozilla/4.0' http://127.0.0.1/target.php
Therefore you have this in your target.txt
username : mysurface (Mozilla/4.0)
Having fun? curl command capable of doing a lots more!







July 30th, 2008 at 5:25 pm
[...] sending HTTP POST using curl command Recently I was having fun with libcurl, discovered that with curl command I capable of doing HTTP POST with specified Us… [...]
February 4th, 2009 at 6:15 am
-d worked for me instead of -F
all in all a powerfull tool, thanks for the article.
I use it to disconnect my Router with one Click.
February 9th, 2009 at 12:36 pm
yeah -d is a better option if you’re have more than one “key=value” pair. My url had 3. Great Article thanks!
February 13th, 2009 at 5:48 am
-d is for GET -F is for post.
February 13th, 2009 at 6:11 am
scratch that, im retarted thnx.
May 13th, 2009 at 9:30 pm
If you want to send an XML in your request:
curl –header ‘content-type: text/xml’ –data @request.xml -X POST http://127.0.0.1
If you want to use HTTPS (ignoring invalid certificates):
curl -k –header ‘content-type: text/xml’ –data @request.xml -X POST https://127.0.0.1
November 23rd, 2010 at 11:52 am
I had never heard of curl… Live and learn…
Worked fantastic under cygwin.
We are using it now at wikispeedia.org
Kudos!
March 3rd, 2011 at 1:31 pm
excent
March 29th, 2011 at 8:19 am
jLUfAc http://djIjw3MnccVop6a5hFgql.com
May 18th, 2011 at 7:54 pm
I’d always want to be update on new content on this web site , saved to my bookmarks ! .
December 19th, 2011 at 2:37 pm
How can we make https request ?
January 7th, 2012 at 3:02 pm
test
January 7th, 2012 at 3:04 pm
test again
February 21st, 2012 at 9:33 pm
this link will help u
a simple example for post using curl
http://phpdog.blogspot.in/2012/02/http-post-using-php-curl.html
April 6th, 2012 at 10:37 pm
a simple example for post using curl will help this to post using curl.
http://www.crashcoder.com/http-post-using-php-curl/
April 20th, 2012 at 7:28 pm
Technical spy software records all type keystrokes activities like online chat conversation, password, username and composed email id.
May 2nd, 2012 at 7:45 am
I’d like to pay this cheque in, please http://opaolate.blog.free.fr/ factory model teen I love this girl but ever sence she had a kid all she does is blow job vids and any time you see her she is covering up her belly and not getting fully into it. dont get me wrong she is one of the hottest girls I have ever seen but if you have a couple of stretch marks cause of a kid dont let it get the better of you.
May 3rd, 2012 at 6:20 pm
I’m originally from Dublin but now live in Edinburgh http://asedaqybybug.de.tl banned nymphet pic i do not like too wait till the fuck scene comes by staring at a guys ass the entire time
May 3rd, 2012 at 10:36 pm
I’m doing a phd in chemistry http://igyryfyo.de.tl model24 bbs why does it always end in CIF? i dont mind but I prefer CIM with a bit of extra pouring out.. nice girl, lucky guy.
March 4th, 2013 at 10:48 pm
Howdy, i read your blog occasionally and i own a similar one and i was just wondering if
you get a lot of spam comments? If so how do you stop it, any plugin
or anything you can advise? I get so much lately it’s driving me insane so any help is very much appreciated.
April 8th, 2013 at 4:24 pm
I don’t like pubs http://www.zoji.com/1230627 lolita lust collection pics lol I wonder how many people were disappointed that there wasn’t any of this in the TV show Brothers and Sisters…
April 10th, 2013 at 11:49 am
Have you got any ? real lolita modles ass definitely schoolgirls that can’t suck a dick. open up your mouth and let that fucker down your throat. fucking sexy when he takes it out and puts his cock in the other one’s mouth. they can’t even take the entire cock in their twats. lame.
April 10th, 2013 at 11:51 am
What line of work are you in? teen porn lolitas top Hot little tighty. I’d bang the shit outta her.