Thank you very much for helping me with this problem. Gisle's recommendation to add push(@LWP::Protocol::http::EXTRA_SOCK_OPTS, MaxLineLength => 16*1024); saves the day. Actually, I kept push(@LWP::Protocol::http::EXTRA_SOCK_OPTS, MaxLineLength => 0); because some people at the other end do things you least expect.
The problem was indeed with the headers. For some reason the script or server at the other end was sending back the whole content of the form as a "Sent" header!!! Something like: HTTP/1.1 200 OK Connection: close Date: Tue, 19 Nov 2002 22:28:09 GMT Server: Microsoft-IIS/5.0 Content-Type: text/xml Client-Date: Tue, 19 Nov 2002 21:59:42 GMT Client-Response-Num: 1 Sent: xmldata=%3C%3Fxml+version%3D%221.0%22%3F%3E%3Cavailreq%3E% 3Cheader+acctno%3D............SOME 12KB OF DATA Poly www.netforall.com/Poly/ > "email" <[EMAIL PROTECTED]> writes: > > > I am using LWP to post a form with one pair name1, $value1 to a CGI > > script. $value1 is very long (8222 bytes), but I can post successfully > > to most servers. However, it failed on IIS 5 and I receive the error: > > 500 Line too long (limit is 4096) > > The "500 Line too long (limit is 4096)" is generated internally in > Net::HTTP when one of the header lines of the response are longer than > this. What is the header value is the server sending back in this > case? > > > When I post the form data using a browser like Netscape, or IE, it > > works, so I suspect there is something that I need to do for LWP to > > work too. Probably breaking $value1 into pieces, but I don't see how. > > Specifying a Content_Length header does not help. My code is something > > like the following. Please let me know if you have any suggestion. > > Try to add this code to your client: > > push(@LWP::Protocol::http::EXTRA_SOCK_OPTS, MaxLineLength => 16*1024); > >
