sending HTTP POST using curl command
September 15th, 2007 mysurface Posted in curl, Network | Hits: 1285561 | 39 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.
July 5th, 2013 at 3:23 am
Now I?im going to hate his original then thought it is because my crow mouth is highly efficacious. If not I would thought grandpa will be suffered from the flesh. Nevertheless, many of the book’s hardcore fans found the movie to be less than perfectly true to the novel, with some concepts added in and the ending substantially changed. Slaughterhouse-Five is a novel by Kurt Vonnegut Jr that was turned into a film directed by George Roy Hill and written by Stephen Geller. jordan retro 13 http://www.google.st/webmasters/tools/richsnippets?url=run2013.org/ceshi9.html
July 5th, 2013 at 10:20 pm
You’ve done more in the past twenty-plus weeks than most guys do in a decade. This has been a great ride.”. It’s the one particular you beat the rush hour for so as to open that door, take a deep breath and sigh with pleasure and satisfaction figuring out everything’s flawless, including the ceiling fans that other individuals take for granted. No mater what your taste are or how selective your significant other is there is positive to be one that will please all and at cost-effective rates too!You’ll discover indoor and outdoors, modern-day and retro, transitional and traditional and also go for that classic always-in-style 1. jordan space jams http://www.google.com.mt/webmasters/tools/richsnippets?url=run2013.org/ceshi15.html
July 5th, 2013 at 10:21 pm
The greatest factor that will help your keep your marriage just isn’t your therapist but you and your companion. The objective of your marriage counselor is to pay attention to and evaluate your state so that he/she may give professional tips. The 8-inch high uppers not only protect you against rocks and brambles, but are part of a guaranteed waterproof system. These are made of full grain water-resistant leather and Cordura, the abrasion-resistant, breathable nylon that is ten times more durable than cotton duck , is llightweight, and dries faster than leather. jordan space jams http://www.google.com.mt/webmasters/tools/richsnippets?url=run2013.org/ceshi8.html
July 22nd, 2013 at 8:31 am
Recorded Delivery
August 9th, 2014 at 11:55 am
Hi there, yeah this post is actually pleasant and I have learned lot of things from it concerning blogging.
thanks.
October 2nd, 2014 at 12:54 pm
Excellent post. I used to be checking constantly
this blog and I’m inspired! Extremely useful information particularly the ultimate section :) I handle such info much.
I used to be seeking this particular info for a very lengthy time.
Thanks and best of luck.
October 10th, 2014 at 5:23 pm
?’m gone to convey my little brother, that he should also visit
this webpage on re?ular basis to obtain updated from newest gossip.
December 21st, 2014 at 6:12 pm
I savour, lead to I discovered just what I was having a look
for. You’ve ended my 4 day lengthy hunt! God Bless you man.
Have a nice day. Bye
October 4th, 2015 at 4:58 pm
I must thank you for the efforts you’ve put in writing this blog.
I am hoping to see the same high-grade blog posts from you
in the future as well. In fact, your creative writing abilities has
motivated me to get my own website now ;)
February 14th, 2017 at 5:39 pm
If you wish for to take a good deal from this paragraph then you
have to apply such techniques to your won website.
February 25th, 2017 at 8:27 pm
Great article!
February 25th, 2017 at 8:28 pm
Great article!
February 25th, 2017 at 8:42 pm
Robot energy drink
March 2nd, 2017 at 11:08 am
chompandslurp wordpress com 2011 11 25 saffs cafe lunch
March 29th, 2017 at 9:02 pm
Um passeio surpreendente na região de Londrina é o Salto do Apucaraninha. Dentro da reserva dos índios Kaingang (por isso sua visita deve ser autorizada pela Funai), a 80 km ao sul do centro da cidade, o salto é uma queda d’água de 116 metros de altura que impressiona pela força das águas e tamanho da queda. Confira no site AltaMontanha um relato com dicas de como chegar lá.
brown timberland roll top boots http://www.yellowtimberlandboots.com/Men's-Timberland-Roll-Top-Boots.html
December 2nd, 2019 at 4:39 am
Video production Houston