The nameless monk is correct in that the Net-HTTP changelog does list several changes with regard to chunked encoding in 6.04, so upgrading to the latest version (currently 6.06) might help you out.

Your problem may stem from the fact that the HTTP response you gave included this header:

Transfer-Encoding: chunked

However, the body of the response is not formatted as a chunked encoding. In chunked encodings, the first line (and various subsequent lines, but I won't go into the details) is expected to be an integer, giving the size of a chunk in bytes. However, the first line of the response body is:

<?xml version="1.0" encoding="UTF-8"?>

Hence the message, "Bad chunk-size in HTTP response".

So the HTTP response is broken. If you have the option of fixing it at that end, that's what you should do. If you can't fix it at that end, then there are a couple of options: patch LWP to cope with the broken HTTP response (and you might get this accepted upstream if you can show it's a common problem, and your patch doesn't harm non-broken HTTP responses); or set up a proxy that fixes broken chunked encoding and make all your requests via the proxy.

package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name

In reply to Re: Trouble with LWP, post request and XML data by tobyink
in thread Trouble with LWP, post request and XML data by thecoder2012

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.