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'
]
);