Ah I spoke too soon, what you said is absolutely correct Liam,
but my program is encoding spaces as %20 whereas
the browser is encoding them as + because its in a form.
How can I make my program encode spaces to + ?
or is there some way I can convert it back to + before I
issue the POST?
Cheers,
Marc
P.S. Heres the whole program:
use strict;
use HTTP::Request::Common qw(POST);
use LWP::UserAgent;
my $ua = LWP::UserAgent->new("My-Agent/LWP");
my $req = POST 'http://xxx.yyy.com',
[ xxx => 'test1', proceed => ' Click here ' ];
my $content = $ua->request($req)->as_string;
-----Original Message-----
From: Liam Quinn [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 29, 2001 10:25 PM
To: Marc Power
Cc: [EMAIL PROTECTED]
Subject: Re: LWP::UserAgent - browser simulation
On Wed, 29 Aug 2001, Marc Power wrote:
> Hi, this is my first ever post here so please forgive me if
> my answer is obvious.
>
> my program has the lines:
>
> my $req = POST 'http://xxx.yyy.com',
> [ xxx => 'test1', proceed => '+Click+here+' ];
>
> my $content = $ua->request($req)->as_string;
>
> the output is:
>
> xxx=test1&proceed=%2BClick%2Bhere%2B
>
> a browser produces:
>
> xxx=test1&proceed=+Click+here+
>
> how can I inhibit the encoding please?
If you enter "+Click+here+" into a form and submit it, the browser
encodes it as "%2BClick%2Bhere%2B". If you enter " Click here " in the
form, the browser encodes it as "+Click+here+".
--
Liam Quinn