Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: LWP::UserAgent error Unexpected keys - LocalHost

by Anonymous Monk
on Jul 29, 2014 at 22:50 UTC ( [id://1095528]=note: print w/replies, xml ) Need Help??


in reply to LWP::UserAgent error Unexpected keys - LocalHost

I used your script without any changes and it worked (downloaded perlmeme.org and perlmeme.org/tutorials/lwp.html)

try this:

... # as before... use Data::Dumper; my $req = GET 'http://www.perlmeme.org'; print Dumper $req->{_headers}; ... if ($res->is_success) { print $res->content; } else { print Dumper $res->{_headers}; }
Also, try Console::Logger. Maybe it will tell something.

Replies are listed 'Best First'.
Re^2: LWP::UserAgent error Unexpected keys - LocalHost
by trendle (Novice) on Jul 29, 2014 at 23:13 UTC

    Thanks

    I tried the extra lines, this is what I got

    $VAR1 = bless( {}, 'HTTP::Headers' ); $VAR1 = bless( { 'client-warning' => 'Internal response', 'client-date' => 'Tue, 29 Jul 2014 23:07:18 GMT', 'content-type' => 'text/plain' }, 'HTTP::Headers' ); >> 500 Unexpected keys - LocalHost

    As I said at the start, I'm not surprised that you were able to make it work, I can too an another PC.

    My problems is that the Mint10 PC that I'm normally using is giving the problem. I'm trying to find out how to fix it. Unfortunately the debugging info is rather hard to get to grips with for a novice.

      Hmm... that's not actually LWP's response (despite that 'internal' stuff). Do you use a proxy by any chance? It seems Python's urllib can automatically detect it. Try
      my $ua = ... # as before $ua->env_proxy; ...
        Oh wait, I forgot - it's actually LWP's response.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1095528]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2024-04-23 23:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found