I am using perl 5.8.0 on cygwin and can't get the LWP library working with the Microsoft Proxie, while lynx is working with no problem (and mozilla too). Here is a script:
use LWP::Debug 'level'; level('+'); use LWP::UserAgent; $pm = 'www.perlmonks.org'; $ua = LWP::UserAgent->new(); $ua->agent("MyApp/0.1 "); $ua->proxy('http', 'http://wawprx01.waw.nestle.pl'); my $res = $ua->get("http://$pm"); print $res->status_line, "\n";
and here is the error stream output (^M where originally is a <CR>):
LWP::UserAgent::new: () LWP::UserAgent::proxy: http http://wawprx01.waw.nestle.pl LWP::UserAgent::request: () LWP::UserAgent::send_request: GET http://www.perlmonks.org LWP::UserAgent::_need_proxy: Proxied to http://wawprx01.waw.nestle.pl LWP::Protocol::http::request: () LWP::Protocol::http::request: GET http://www.perlmonks.org HTTP/1.1^M TE: deflate,gzip;q=0.3^M Connection: TE, close^M Host: www.perlmonks.org^M User-Agent: MyApp/0.1 libwww-perl/5.68^M ^M LWP::Protocol::collect: read 87 bytes LWP::UserAgent::request: Simple response: Bad Request
I've removed the '#' in the LWP::Protocol::http.pm line 207 to print the literary request. Has anybody a clue what's wrong?

update (broquaint): fixed typo in subject (s/Proxie$/Proxy/)


In reply to LWP::UserAgent on cygwin and Microsoft Proxy by zby

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.