The response isuse LWP::UserAgent; use HTTP::Request::Common qw(POST); my $ua = LWP::UserAgent->new() || die "Unable to create new UserAgent +object"; my $url = 'http://cosmias02d.mwh.com:7778/reports/rwservlet'; my %form_data = ( SERVER => 'repcosmias02d', USERID => 'mwh/prahd@dev', REPORT => 'ap_daily_jrnl.rep', DESTYPE => 'PRINTER', DESNAME => 'cohpisd012', DESFORMAT => 'hplwide', STATUSFORMAT => 'xml' ); my $request = POST($url, \%form_data); my $response = $ua->request($request); $response->remove_header(); $content = $response->as_string(); print "$content\n";
HTTP/1.1 200 OK
Cache-Control: private
Connection: close
Date: Tue, 09 Sep 2003 23:08:26 GMT
Server: Oracle9iAS/9.0.2 Oracle HTTP Server
Content-Language: en
Content-Type: text/xml
Client-Date: Tue, 09 Sep 2003 23:08:27 GMT
Client-Peer: 172.25.209.185:7778
<?xml version = '1.0' encoding = 'ISO-8859-1' standalone = 'yes'?>
<serverQueues>
<job id="117" queueType="past">
<name>ap_daily_jrnl.rep</name>
<type>report</type>
<status code="4">Finished successfully</status>
<owner>RWUser</owner>
<server>repcosmias02d</server>
<destination>
<desType>PRINTER</desType>
<desName>cohpisd012</desName>
<desFormat>unknown</desFormat>
<file>39872723.txt</file>
</destination>
<timingInfo>
<queued>9/9/03 4:08 PM</queued>
<started>9/9/03 4:08 PM</started>
<finished>9/9/03 4:08 PM</finished>
</timingInfo>
</job>
</serverQueues>
What is the best way to strip off the header section so I can pass the xml document into an xml parser?
edited: Wed Sep 10 02:41:28 2003 by jeffa - code tags for code (left the pre tags for response)
In reply to What is the best way to get the response payload by mifflin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |