Why is Net :: Twitter complaining about "HTTP :: Message content not bytes"?

We use Perl Net: Twitter CPAN module (version 3.12) and basic authentication (and not OAuth) almost a year ago, the syndicate of updates from our website to our Twitter account. Last week, we switched to a new server, and since the transition, our updates on Twitter have stopped, and with each attempt to publish an update, the following message is displayed:

HTTP::Message content not bytes at /usr/lib/perl5/site_perl/5.8.8/HTTP/Request/Common.pm line 90 

Here is the code we use in our Twitter account:

 use Net::Twitter; my $twitter = Net::Twitter->new( traits => [qw/API::REST/], username => $username, password => $password, source => 'twitterfeed' ); my $result = $twitter->update($status); 

I have no idea what the problem is, and was hoping that someone else would run into this problem and could provide a quick solution. Thanks in advance for your help!

+4
source share
1 answer

Most complaints about this error seem to be resolved by updating libwww-perl and SOAP :: Lite . When Perl made the switch to represent the internal lines as UTF-8, it took some time for the modules to catch up. It was so easy to assume that all the strings were octets, so most modules did not bother with coding, etc. Most core modules should be fixed by now.

Try using Google for "HTTP :: Message content not bytes" to find out how other people solved it. In general, when searching for an error message, a lot of useful discussions often appear. :)

+1
source

Source: https://habr.com/ru/post/1307691/


All Articles