Phoenix.pm: LWP POST problems

Matt Alexander m at phxlinux.org
Thu May 6 17:22:43 CDT 2004


I'm trying to post a URL-encoded character as part of the input to a
website using LWP.  Here's a code example:

$browser = LWP::UserAgent->new();
%formvars = ('somevar' => '%FC');
$response = $browser->post($url, \%formvars);

When I run the code above I get a message from the CGI script on the
server saying that '%' can't be used in the input field.  It works fine,
however, when I post an ASCII character that doesn't need to be encoded.

Using curl, I can post to the server and get the desired results:

curl http://somewebsite.com -d somevar="%FC"

Any suggestions on how to get LWP to work the same as curl?
Thanks,
~M






More information about the Phoenix-pm mailing list