<div dir="ltr">Hi Landon,<div><br></div><div>For some reason the result is not being written in log files (I'll have to check my RT_SiteConfig.pm :)</div><div>I parsed the response directly and I got what I needed.</div><div><br></div><div>Thank you</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 2, 2015 at 2:55 PM, Landon Stewart <span dir="ltr"><<a href="mailto:lstewart@iweb.com" target="_blank">lstewart@iweb.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><span class=""><blockquote type="cite"><br>On Apr 2, 2015, at 11:03 AM, Hugo Escobar <<a href="mailto:hescobar@afslc.com" target="_blank">hescobar@afslc.com</a>> wrote:<br><br>Hi,<br><br>I'm trying to write a scrip that sends a web request to an external server<br>and depending on the answer set a specific priority level<br><br>So far the web request goes out and the priority can be set. The only <br>missing part is that I can't get a hold of the external web server response.<br><br></blockquote><div><br></div></span>Hi Hugo,<div><br></div><div>Firstly - Does <a href="https://extwebserv/" target="_blank">https://extwebserv/</a> have a real certificate?<br><br>Try the following instead. I haven't tested it but basically it tries the URL and sets the priority if it was successful. It also logs the response message (a short human readable single line string that explains the response code) regardless of what it was. It returns whatever $status is (if it's set then it'll be non-zero).<br><br><div><font face="Courier New">use LWP::UserAgent;</font></div><span class=""><div><span style="font-family:'Courier New'"><br></span></div><div><span style="font-family:'Courier New'">my $url = '</span><span style="font-family:'Courier New'"><a href="https://extwebserv/'.somePieceOfData" target="_blank">https://extwebserv/'.somePieceOfData</a></span><span style="font-family:'Courier New'">;</span></div></span><div><span style="font-family:'Courier New'">RT::Logger->info("Ticket ".$self->TicketObj->id." Checking ".$url</span><span style="font-family:'Courier New'">);</span></div><span class=""><div><font face="Courier New">my $ua = LWP::UserAgent->new;</font></div></span><font face="Courier New">my $response = $ua->get($url);<br>my ($status, $msg); # Set these up as empty for now<br>($status, $msg) = $self->TicketObj->SetPriority('100') if $response->is_success;<br>RT::Logger->info("Ticket ".$self->TicketObj->id." ".$response->message);<br>return $status;<br></font><br><br><div>Landon Stewart : <a href="mailto:lstewart@iweb.com" target="_blank">lstewart@iweb.com</a><br>Lead Specialist, Abuse and Security Management<br>Spécialiste principal, gestion des abus et sécurité<br><a href="http://iweb.com" target="_blank">http://iweb.com</a> : +1 (888) 909-4932</div><br></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Regards,<br><br>Hugo Escobar<br><br>
<div><a href="http://www.associationfinancialservices.com/" target="_blank"><img src="cid:part1.02030600.00030308@enflyer.com" height="26" width="126" border="0"></a><br><br></div>4770 Biscayne Blvd, Ste 700<br>Miami, FL 33137<br>
<br>main: 305.677.0022<br>support: 305.921.4620<br>email: <a href="mailto:hescobar@afslc.com" target="_blank">hescobar@afslc.com</a><br><br>Follow us on Facebook and Linked-In<br>
<div><a href="http://www.facebook.com/pages/Miami-FL/ASSOCIATION-FINANCIAL/64952991864" target="_blank"><img alt="" src="cid:part1.08060004.03030107@enflyer.com" height="24" width="24" border="0"></a> <a href="http://www.linkedin.com/companies/1006276" target="_blank"><img alt="" src="cid:part2.00090205.04060608@enflyer.com" height="24" width="24" border="0"></a> </div>
<br>NOTICE: This email and any attachment to this email may contain
confidential information. If you are not the intended recipient, you
must not review, retransmit, convert to hard copy, photocopy, use or
disseminate this email or any attachments to it. If you have received
this email in error, please notify us immediately by return email and
delete this message. Please note that if this email contains a forwarded
message or is a reply to a prior message, some or all of the contents
of this message or any attachments may not have been produced by our
firm. <b>As our firm may be deemed a debt collector, if your payment is
in default, we may be attempting to collect a debt on behalf of the
association, and any information obtained may be used for that purpose.</b><br></div></div>
</div></div>