|Think about Loose Coupling|
LWP HTTP Request POST being sent in two packetsby Anonymous Monk
|on Oct 10, 2002 at 16:00 UTC||Need Help??|
Anonymous Monk has asked for the
wisdom of the Perl Monks concerning the following question:
I'm trying to automate some data submission to a web page. There are 3 different forms I need to use, 2 submit via GET and the 3rd via POST. I've got the code for the GET forms working fine, however the POST is unsuccesful.
If I change the 3rd to a GET, it is partially successful. The first half of the fields are properly submitted, but the latter half is lost.
I realize that this is because GET requests can consist only of header info and are limited to 512 byes. This 3rd post is approaching 600 bytes, and the latter fields are not received/processed because the data for them falls beyond that limit.
If I submit the form as a POST I get a "200 Created" status line, but the web server does not process the transmission. This is not Apache/IIS/Netscape. It is a proprietary wwww server for a networking monitoring tool, WhatsUp from IpSwitch.
I think the problem with the POST is that Perl breaks the headers and the content for the POST into 2 different packets. The same submission from IE is a single packet. I realize this probably means that the web server is not completely HTTP compliant, but I'm stuck with it and have no other options.
I have tried using LWP "send_request" and "simple_request" because the docs says "these methods dispatch a single request" whereas "request" which says "this method may actually send several different requests" but they do not perform any differently. All three methods make the transmission as 2 packets, one for headers and another for content.
Looking for any suggestions on how to submit a POST from within Perl that only consists of a single packet.