Phoenix.pm: LWP POST problems

Matt Alexander m at phxlinux.org
Thu May 6 18:15:03 CDT 2004


On Thu, 6 May 2004, Eden Li wrote:

> According to LWP::UserAgent (and HTTP::Request::Common) docs, it appears 
> that the quoted field does in fact get quoted correctly.  Have you tried 
> using a web browser to input these values yourself?  It's possible curl 
> is doing something strange with that % sign that you may not know about.
> 
> Here's an excerpt from HTTP::Request::Common docs (which is used by 
> LWP::UserAgent)
> 
>    POST 'http://www.perl.org/survey.cgi',
>         [ name   => 'Gisle Aas',
>           email  => 'gisle at aas.no',
>           gender => 'M',
>           born   => '1964',
>           perc   => '3%',
>         ];
> 
> This will create a HTTP::Request object that looks like this:
> 
>    POST http://www.perl.org/survey.cgi
>    Content-Length: 66
>    Content-Type: application/x-www-form-urlencoded
> 
>    name=Gisle%20Aas&email=gisle%40aas.no&gender=M&born=1964&perc=3%25


Mozilla has no problem when I input special characters and when I use the
Live HTTP Headers Mozilla plugin to watch the HTTP session, I see that
Mozilla has encoded the character correctly in the headers.

I can't think of anything that curl would be doing that's strange since
the POST works as it should and the server responds correctly.

Is there a way to output the LWP headers as they are sent to the server?
Then I could at least verify that LWP is creating the POST correctly
before the server receives it.
Thanks,
~M




More information about the Phoenix-pm mailing list