Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (3)
As of 2024-03-19 07:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found