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

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Stick with POST. GET just gives you an "incorrect" warning; however, using POST will give you an exception. Here's the code that I ran:
#!/usr/bin/perl -l use strict; use warnings; use Encode; use Encode::Locale; require LWP::UserAgent; require HTTP::Request; my $ua = LWP::UserAgent->new( ssl_opts => { verify_hostname => 0 } ); $ua->agent("Mozilla/8.0"); $ua->timeout(10); $ua->protocols_allowed( ['https'] ); my $req = HTTP::Request->new( 'POST', '' ); $req->header( 'Accept' => 'text/html' ); my $res = $ua->request($req); if ( $res->is_success ) { print $res->decoded_content; } else { print "Error: " . $res->status_line . "\n"; }
And the result:
<!-- RSisException --><html> <head> <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1 +"> <meta content="-1" http-equiv="Expires"> <meta content="Monday, 01-Jan-90 00:00:00 GMT" http-equiv="Expires"> <meta content="no-cache" http-equiv="Pragma"> <meta content="no-cache" http-equiv="Cache-Control"> <script type="text/javascript" src="/dtagent56_n3_5964.js" data-dtconf +ig="rid=RID_1948368250|rpid=272727326|tp=500,50,0|">< +/script><link type="text/css" href="/sis/estilos/unica/9999.css" rel= +"StyleSheet"> <link type="text/css" rel="StyleSheet" href="/sis/estilos/.css"> <script src="/sis/javascript/xsl/RSisException.js" type="text/javascri +pt"></script><script src="/sis/javascript/utilSis.js" type="text/java +script"></script> </head> <body onload="load()"> <div id="divCuerpo" style="overflow:auto;height:90%;"> <table class="contenedor"> <tr> <td height="52" colspan="2" align="right" class="tituloSuperior"><img +height="52" onerror="this.src='/sis/graficos/logotipos/comunes/redsys +.gif';" src="/sis/graficos/logotipos/comunes/-1.gif" alt="Terminal de + pagos virtuales"></td> </tr> <tr> <td colspan="2" class="separador">&nbsp;</td> </tr> <tr> <td colspan="2" class="resultado"><font class="denegacion"> <!--:--></font></td> </tr> <tr> <td colspan="2" class="separador">&nbsp;</td> </tr> <tr> <td colspan="2" class="botones"> <form action="" method="get"> <div style="position:relative;visibility:hidden" id="divImg"> <input type="button" class="botonAccion" onmouseover="hov(this,'botonA +ccion btnhov')" onmouseout="hov(this,'botonAccion')" value="Imprimir" + onClick="javascript:imprimir();" alt="Imprimir"><input type="button" + class="botonAccion" onmouseover="hov(this,'botonAccion btnhov')" onm +ouseout="hov(this,'botonAccion')" value="Cerrar" onClick="window.clos +e();" alt="Cerrar"> </div> <div style="position:relative;visibility:visible" id="divImgNoScript"> <NOSCRIPT value="Imprimir"> &nbsp; <input type="submit" class +="buttonAccion" value="Cerrar" ALT="Pulse el bot&oacute;n para cerrar +"> </NOSCRIPT> </div> </form> </td> </tr> </table> </div> <div id="divPie" style="overflow:visible; height:55px;"> <table cellpadding="0" cellspacing="0" border="0" width="100%"> <tr style="background-color:#8e9092;"> <td height="52" style="width:100%">&nbsp;</td> </tr> </table> </div> </body> </html>

Make sure that you have these modules installed:


In reply to Re: 500 error with LWP:UserAgent by Khen1950fx
in thread 500 error with LWP:UserAgent by RenardBleu

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others avoiding work at the Monastery: (4)
    As of 2020-04-10 04:27 GMT
    Find Nodes?
      Voting Booth?
      The most amusing oxymoron is:

      Results (49 votes). Check out past polls.