use strict; use WWW::Mechanize; use WWW::Mechanize::FormFiller; my $mechanize = WWW::Mechanize->new( autocheck => 1 ); my $formfiller = WWW::Mechanize::FormFiller->new(); $mechanize->add_handler("request_send", sub { shift->dump; return }); $mechanize->proxy(['http', 'ftp', 'https'], 'http://tant-a01\\santu:Xi +us12345678@naproxy.XXX.com:80'); $mechanize->get('http://www.redhat.com'); $mechanize->add_handler("response_done", sub { shift->dump; return }); #$mechanize->get('https://www.redhat.com'); print $mechanize->status(); my $page = $mechanize->content; print $page; OUTOPUT GET https://www.redhat.com Accept-Encoding: gzip User-Agent: WWW-Mechanize/1.60 (no content) Error GETing https://www.redhat.com: Bad Request at test.pl line 10 Another try use strict; use WWW::Mechanize; use WWW::Mechanize::FormFiller; my $mechanize = WWW::Mechanize->new( autocheck => 1 ); my $formfiller = WWW::Mechanize::FormFiller->new(); $mechanize->add_handler("request_send", sub { shift->dump; return }); $mechanize->add_handler("response_done", sub { shift->dump; return }); $mechanize->proxy(['http', 'ftp', 'https'], 'http://tant-a01\\santu:Xi +us12345678@naproxy.XXX.com:80'); $mechanize->get('http://www.redhat.com'); #$mechanize->get('https://www.redhat.com'); print $mechanize->status(); my $page = $mechanize->content; print $page; OUTPUT GET https://www.redhat.com Accept-Encoding: gzip User-Agent: WWW-Mechanize/1.60 (no content) HTTP/1.1 400 Bad Request Cache-Control: no-cache Connection: close Pragma: no-cache Content-Length: 691 Content-Type: text/html; charset=utf-8 Client-Date: Wed, 10 Mar 2010 08:47:21 GMT Client-Peer: 141.202.248.209:80 Client-Response-Num: 1 Title: Request Error <HTML><HEAD> <TITLE>Request Error</TITLE> </HEAD> <BODY> <FONT face="Helvetica"> <big><strong></strong></big><BR> </FONT> <blockquote> <TABLE border=0 cellPadding=1 width="80%"> <TR><TD> <FONT face="Helvetica"> <big>Request Error (invalid_request)</big> <BR> <BR> </FONT> </TD></TR> <TR><TD> <FONT face="Helvetica"> Your request could not be processed. Request could not be handled </FONT> </TD></TR> <TR><TD> <FONT face="Helvetica"> This could be caused by a misconfiguration, or possibly a malformed re +quest. <... (+ 179 more bytes not shown) Error GETing https://www.redhat.com: Bad Request at test.pl line 11
</code>

In reply to Re^6: Mechanize https proxy not working by vishnu787
in thread Mechanize https proxy not working by vishnu787

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.