Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

libwww-perl-5.810 (HTTP::Message content not bytes)
"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_authentica
tion) {

$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





Report this thread to moderator Post Follow-up to this message
Old Post
Shaun
04-15-08 01:31 AM


Re: libwww-perl-5.810 (HTTP::Message content not bytes)
* 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 thread to moderator Post Follow-up to this message
Old Post
Bjoern Hoehrmann
04-15-08 01:31 AM


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 thread to moderator Post Follow-up to this message
Old Post
Gisle Aas
04-15-08 01:31 AM


RE: libwww-perl-5.810 (HTTP::Message content not bytes)
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 thread to moderator Post Follow-up to this message
Old Post
Shaun
04-15-08 01:31 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

LibWWW archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 10:23 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.