I have written a script that pops some values into a database table, then, on the basis of that, performs an SQL Query to extract values across a range of tables, then build them into a URL for posting onwards to another site. So far, so good.

The problem arises, however, when I use LWP to post the values onto the server.

The script (which I have not seen, though it is an asp script), returns an HTTP 411 Content-Length expected error.

I know that the values are properly encoded, as they work when posted experimentally from a browser.

I suppose that what I'm really asking (having looked into setting values in the HTTP::Header section), is how to determine a Content-Length value, so that LWP does not report an error saying that "Content-Length set when there is not content, fixed at /usr/lib/perl5/vendor_perl/5.8.0/LWP/Protocol/http.pm line 194'.

Apart from the results returned from the server, there isn't much else that I can add.

Any help greatly appreciated.


In reply to Forcing Content-Length Value in LWP 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.