cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: sending "multiline" post?

From: Lolita <lolitka_at_gmail.com>
Date: Mon, 5 Sep 2005 18:58:20 +0200

hmm i tried

C:\>curl -v -0 -A "Mozilla/4.0 (compatible; Synapse)" -d
"$FORMAT$=GameList\n$VER$=1.01\nPLAYER=Lolita*\nID=5056295546\nT=16"
http://80.188.162.104:26500/cgi-bin/gameserver.cgi

and it sends

POST /cgi-bin/gameserver.cgi HTTP/1.0
User-Agent: Mozilla/4.0 (compatible; Synapse)
Host: 80.188.162.104:26500
Accept: */*
Content-Length: 66
Content-Type: application/x-www-form-urlencoded
$FORMAT$=GameList\n$VER$=1.01\nPLAYER=Lolita*\nID=5056295546\nT=16

so then i tried

C:\>curl -v -0 -A "Mozilla/4.0 (compatible; Synapse)" -d
@C:\test-curl.txt http://80.188.162.104:26500/cgi-bin/gameserver.cgi

and agin it sends
....
Content-Type: application/x-www-form-urlencoded

$FORMAT$=GameList$VER$=1.01PLAYER=Lolita*ID=5056295546T=16"HTTP/1.0 200 OK

(i captured it with ethereal and not only with -v to make sure if the
sent data are same)

here: http://www.2and2.net/Uploads/Documents/test-curl.txt is link for
that file i used

On 9/5/05, Daniel Stenberg <daniel-curl_at_haxx.se> wrote:
> On Mon, 5 Sep 2005, Lolita wrote:
>
> > how can i send post to look like this
> > http://img400.imageshack.us/my.php?image=gzpeknejsivec9ql.gif ?
> >
> > i tried curl -0 -A "Mozilla/4.0 (compatible; Synapse)" -d
> > "$FORMAT$=GameList" -d "$VER$=1.01" -d "PLAYER=Lolita*" -d "ID=5056295546"
> > -d "T=16" http://80.188.162.104:26500/cgi-bin/gameserver.cgi but it sends it
> > like it is in manual "$FORMAT$=GameList&$VER$=1.01" ....
>
> Yes, that's how -d does when you use write multiple ones.
>
> You should instead add the whole post in a single string with embedded
> newlines like:
>
> -d "foo\nmooo\nlalalal\n"
>
> or have a file pre-written that you can post:
>
> $ cat file
> name=moo
> age=none
> iq=13
> $ curl -d @file http://postdasite.com/
>
> --
> Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
>
Received on 2005-09-05