use LWP; use LWP::UserAgent; $host = '16.183.90.81'; $port = '8004'; $uri = '/a=getstatus'; $http = 'http'; $lwp_user_agent = LWP::UserAgent->new; $lwp_user_agent->timeout($timeout); if ( $port == 80 || $port == 443 || $port eq "" ) { $lwp_user_agent->default_header('Host' => $host); } else { $lwp_user_agent->default_header('Host' => "$host:$port"); } $url = "$http://$host:${port}$uri"; $http_request = HTTP::Request->new(GET => $url); print "--------------- GET $url"; print $lwp_user_agent->default_headers->as_string . $http_request->hea +ders_as_string; $http_response = $lwp_user_agent->request($http_request); print "---------------\n" . $http_response->protocol . " " . $http_res +ponse->status_line; print $http_response->headers_as_string; print "Content has " . length($http_response->content) . " bytes \n"; if ($http_response->is_success) { $body = $http_response->content; print $body; }
This above script when I use for particular site, running on my machine on port 8004, then I'm able to get the output accordingly. But, when I use this script on another machine, on port 20000, then I m not getting any output. Please see the link below for which ACI port i'm talking about and not getting any output for this case.
https://www.novell.com/documentation/extend52/Docs/help/exteNd/books/e +xt521_Autonomy.html
this is the same exact scenerio, there you can see, one has to open a browser and run - http://localhost:20000/a-getstatus . I too want to query the interface port through perl and see the output.

In reply to Re^2: Fetch output coming as an xml format by Ordig
in thread Fetch output coming as an xml format by Ordig

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.