Bookmarks

Yahoo Gmail Google Facebook Delicious Twitter Reddit Stumpleupon Myspace Digg

Search queries

192.168.1.41:8000, Www.xxxcon., %s wwwxxxcon, %s wwwxxxcon, www.xxxcon, xxxxdup, bitlord outgoing port settings, ckowwwxxx, 192.168.1.41:8000/nor-482.html, php.ini "Unable to initialize module"

Links

XODOX
Impressum

#1: libwww-perl-5.810 (HTTP::Message content not bytes)

Posted on 2008-04-14 20:21:20 by mailinglists

------=_NextPart_000_00C5_01C89E21.AB886050
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit

"Don't allow HTTP::Message content to be set to Unicode strings."



I'm going to assume this change above is whats breaking my scripts. My
script is using NicToolServerAPI.pm which in turn uses LWP::UserAgent. The
script dies out with the error above when I run it. I'm not sure what has
to be done, my guess is that the script is POST'ing the URL in plain text
and it needs to be in some other format. I've snipped out a few pieces of
code in hopes that somebody here might be able to give me a quick fix.



===NicToolServerAPI.pm Snip calling LWP::UserAgent====

my $ua = new LWP::UserAgent;

my $req = HTTP::Request->new('POST',$url);





===NicToolServerAPI.pm snip setting $url====



sub send_request {

my $self = shift;

my $url;

if ($NicToolServerAPI::use_https_authentication) {

$url = 'https://'.$NicToolServerAPI::server_host.':'
..$NicToolServerAPI::https_server_port;

} else {

$url = 'http://'.$NicToolServerAPI::server_host.':'
..$NicToolServerAPI::server_port;

}

my $func = 'send_'.$NicToolServerAPI::data_protocol.'_request';

if ($self->can($func)) {

return $self->$func($url,@_);

} else {

return {'error_code'=>501,'error_msg'=>'Data protocol not supported:
'.$NicToolServerAPI::data_protocol};

}

}







Anybody know what I need to do to convert $url to bytes? Is this just a
base64 encode or something?





~Shaun




------=_NextPart_000_00C5_01C89E21.AB886050--

Report this message

#2: Re: libwww-perl-5.810 (HTTP::Message content not bytes)

Posted on 2008-04-14 20:27:54 by derhoermi

* Shaun wrote:
>"Don't allow HTTP::Message content to be set to Unicode strings."
>
>I'm going to assume this change above is whats breaking my scripts. My
>script is using NicToolServerAPI.pm which in turn uses LWP::UserAgent. The
>script dies out with the error above when I run it. I'm not sure what has
>to be done, my guess is that the script is POST'ing the URL in plain text
>and it needs to be in some other format. I've snipped out a few pieces of
>code in hopes that somebody here might be able to give me a quick fix.

Presumably you have to clear the string you are passing in of the UTF-8
flag, e.g. by using Encode::encode or perhaps Encode::_utf8_off.
--
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/

Report this message

#3: Re: libwww-perl-5.810 (HTTP::Message content not bytes)

Posted on 2008-04-14 22:21:00 by gisle

Can you try if the newly upload libwww-perl-5.811 fixes your problem.
It will not complain about Unicode strings unless they actually
contain chars that can't be treated as bytes.

--Gisle

Report this message

#4: RE: libwww-perl-5.810 (HTTP::Message content not bytes)

Posted on 2008-04-14 22:55:09 by mailinglists

This version looks to have fixed the problem! Thanks

~Shaun

-----Original Message-----
From: gisle.aas@gmail.com [mailto:gisle.aas@gmail.com] On Behalf Of Gisle
Aas
Sent: Monday, April 14, 2008 1:21 PM
To: Shaun
Cc: libwww@perl.org
Subject: Re: libwww-perl-5.810 (HTTP::Message content not bytes)

Can you try if the newly upload libwww-perl-5.811 fixes your problem.
It will not complain about Unicode strings unless they actually
contain chars that can't be treated as bytes.

--Gisle

Report this message