This is the code that is sending the headers & content in 2 different packets.
I've also tried a different version using query_form() from the URI module. With that it is all send as a single packet, but the parameters are then part of the URI and not the content. Can someone confirm if query_form should only be used with GETs?
use HTTP::Request::Common;
use LWP::UserAgent;
$ua = LWP::UserAgent->new;
$ua->request(POST 'http://user:password@z.y.z.com/devicesave.asp',
Content_Type => 'application/x-www-form-urlencoded',
Referer => 'http://x.y.z.com/newdevice.asp?map=CHI.wu
+p',
Content => [
'map' => 'CHI.wup',
'CreateNewDevice' => 'true',
'Title' => 'node',
'HostName' => 'node.acme.com',
'IP' => '127.0.0.1',
'PollType' => 'ICMP',
'HostType' => 'Server',
'Info1' => 'info1',
'Info2' => 'info2',
'Snmp' => '1',
'ReadComm' => 'read',
'WriteComm' => 'write',
'OID' => '',
'Logging' => '1',
'Monitoring' => '1',
'StartTime' => '0000',
'EndTime' => '2400',
'Sun' => '1',
'Mon' => '1',
'Tues' => '1',
'Wedn' => '1',
'Thur' => '1',
'Fri' => '1',
'Sat' => '1',
'PollFreq' => '1',
'TimeOut' => '5000',
'DownDep' => '0',
'UpDep' => '0',
'Notes' => '',
'end' => 'end'
]
);
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.