<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><blockquote type="cite" class=""><br class="">On Apr 2, 2015, at 11:03 AM, Hugo Escobar <<a href="mailto:hescobar@afslc.com" class="">hescobar@afslc.com</a>> wrote:<br class=""><br class="">Hi,<br class=""><br class="">I'm trying to write a scrip that sends a web request to an external server<br class="">and depending on the answer set a specific priority level<br class=""><br class="">So far the web request goes out and the priority can be set. The only <br class="">missing part is that I can't get a hold of the external web server response.<br class=""><br class=""></blockquote><div class=""><br class=""></div>Hi Hugo,<div class=""><br class=""></div><div class="">Firstly - Does <a href="https://extwebserv/" class="">https://extwebserv/</a> have a real certificate?<br class=""><br class="">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 class=""><br class=""><div class=""><font face="Courier New" class="">use LWP::UserAgent;</font></div><div class=""><span style="font-family: 'Courier New';" class=""><br class=""></span></div><div class=""><span style="font-family: 'Courier New';" class="">my $url = '</span><span style="font-family: 'Courier New';" class=""><a href="https://extwebserv/'.somePieceOfData" class="">https://extwebserv/'.somePieceOfData</a></span><span style="font-family: 'Courier New';" class="">;</span></div><div class=""><span style="font-family: 'Courier New';" class="">RT::Logger->info("Ticket ".$self->TicketObj->id." Checking ".$url</span><span style="font-family: 'Courier New';" class="">);</span></div><div class=""><font face="Courier New" class="">my $ua = LWP::UserAgent->new;</font></div><font face="Courier New" class="">my $response = $ua->get($url);<br class="">my ($status, $msg);  # Set these up as empty for now<br class="">($status, $msg) =  $self->TicketObj->SetPriority('100') if $response->is_success;<br class="">RT::Logger->info("Ticket ".$self->TicketObj->id." ".$response->message);<br class="">return $status;<br class=""></font><br class=""><br class=""><div class="">Landon Stewart : <a href="mailto:lstewart@iweb.com" class="">lstewart@iweb.com</a><br class="">Lead Specialist, Abuse and Security Management<br class="">Spécialiste principal, gestion des abus et sécurité<br class=""><a href="http://iweb.com" class="">http://iweb.com</a> : +1 (888) 909-4932</div><br class=""></div></body></html>