cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Re: Shell Script and Curl HELP!

From: Kevin Carothers <kevindotcar_at_gmail.com>
Date: Thu, 30 Mar 2006 21:24:19 -0800

Just to add;
Use the "-v" option to "prove" that you're doing a POST... as some web
servers get weird about URL's with anything to the right of the
question-mark.

For instance, I sometimes have to do a POST in the form of:
http://www.nowhere.com/page.aspx?param=this

 With the -d option, and data like; "this=that&x=y"

 ...And it WON'T work with a URL of
   http://www.nowhere.com/page.aspx

and -d data of "param=this&this=that&x=y"

...You soon will find that the "big trick" with CURL is "reverse
engineering" what the remote site is doing.

BUT- just out of curiosity... are you speaking of posting a file to a web
server? If so, things get a little complicated on the web server side...
The web server needs to specifically allow this. I in fact have never tried
file upload with CURL- and if I have time, I may just try it tomorrow :-)

Tenga Cuidado (did I say that right?)

Kevin

On 3/30/06, Simon Yorkston <simon_at_ice.org> wrote:
>
> Read http://curl.haxx.se/docs/manpage.html
> With special attention to the switch:
>
> -d/--data <data>
>
> (HTTP) Sends the specified data in a POST request to the HTTP server, in
> a way that can emulate as if a user has filled in a HTML form and
> pressed the submit button. Note that the data is sent exactly as
> specified with no extra processing (with all newlines cut off). The data
> is expected to be "url-encoded". This will cause curl to pass the data
> to the server using the content-type application/x-www-form-urlencoded.
> Compare to -F/--form <#-F--form>. If this option is used more than once
> on the same command line, the data pieces specified will be merged
> together with a separating &-letter. Thus, using '-d name=daniel -d
> skill=lousy' would generate a post chunk that looks like
> 'name=daniel&skill=lousy'.
>
> This is def. where you should start!!!!!!! !!!!!!!!! ??????????
> !!!!!!!!!!!!
>
>
> Renato Bonicio wrote:
>
> > Hi all!!!!
> >
> > I need a simple example of how to post values using curl in Shell
> > script!!!
> >
> > is there a way?!?!?!?!
> >
> > Thanks very much!!
> >
> >
> > Renato / Brazil
> >
> >------------------------------------------------------------------------
> >
> >_______________________________________________
> >http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
> >
> >
> _______________________________________________
> http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
>

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2006-03-31