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.

Thanks


In reply to LWP HTTP Request POST being sent in two packets by Anonymous Monk

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.