OK, (and thanks for responding)
Here're the relavant code fragments.

(The credentials are fine. I know because if I use the filename method I get the expected response in the file).

Note: 903 bytes + 3770 bytes = 4673 bytes = size of "rspfile" if I use filename method)

(Also, though not coded in this fragment, if I print $response->content before testing for error - it appears empty)

I suspect, after digging a bit, that socket or HTTP layer is not happy with the LinkSys dropping the connection before sending an EOF or something of the sort.

I could drop the
$response = $ua->request($request.......);
and go to a lower level or I could use the filename method and read the legitimate content back in - but I'd rather fix the UserAgent than patch it! ;)

. . use AppConfig; use File::Basename; use Getopt::Long; use HTML::Form; use HTTP::Request::Common; use HTML::TreeBuilder; use LWP::DebugFile ('+'); use LWP::UserAgent; use Pod::Usage; use URI::file; . . $ua = LWP::UserAgent->new(); $ua->agent('Mozilla/4.0'); $ua->max_size('5000'); . . $ua->credentials($netloc, $realm, $userid, $passwd); . . $request = HTTP::Request->new(GET => "http://192.168.1.1/Status.htm"); $response = $ua->request($request); #$response = $ua->request($request,"rspfile.html"); if ($response->is_error) { my $string; print "Error: " . $response->status_line . "\n"; print $response->error_as_HTML; $string = $response->as_string; die "$string\n"; } . . ---------------- FreeBSD/i386 (blah blah blah) login: steve Password: Last login: Wed May 21 16:59:51 from 192.168.1.1 Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994 The Regents of the University of California. All rights reser +ved. FreeBSD 4.7-RELEASE (ACCESS) #0: Tue Feb 11 19:33:55 EST 2003 Welcome blah blah blah steve> cd perlstuff steve/perlstuff> ./LinkSys.pl getting http://192.168.1.1/Status.htm... Error: 500 Can't read entity body: Connection reset by peer <HTML> <HEAD><TITLE>An Error Occurred</TITLE></HEAD> <BODY> <H1>An Error Occurred</H1> 500 Can't read entity body: Connection reset by peer </BODY> </HTML> 500 (Internal Server Error) Can't read entity body: Connection reset b +y peer Client-Date: Thu, 22 May 2003 12:43:11 GMT ----------------- Log:- # LWP::DebugFile logging to lwp_3eccc413_2a9d.log # Time now: {1053606945} = Thu May 22 08:35:45 2003 # Time now: {1053606959} = Thu May 22 08:35:59 2003 LWP::UserAgent::new: () # Time now: {1053606960} = Thu May 22 08:36:00 2003 LWP::UserAgent::request: () LWP::UserAgent::send_request: GET http://192.168.1.1/Status.htm LWP::UserAgent::_need_proxy: Not proxied # Time now: {1053606965} = Thu May 22 08:36:05 2003 LWP::Protocol::http::request: () # Time now: {1053606966} = Thu May 22 08:36:06 2003 LWP::Protocol::collect: read 340 bytes LWP::UserAgent::request: Simple response: Unauthorized # Time now: {1053606967} = Thu May 22 08:36:07 2003 LWP::UserAgent::request: () LWP::UserAgent::send_request: GET http://192.168.1.1/Status.htm LWP::UserAgent::_need_proxy: Not proxied LWP::Protocol::http::request: () LWP::Protocol::collect: read 903 bytes LWP::Protocol::collect: read 3770 bytes LWP::UserAgent::request: Simple response: Internal Server Error ttyp0://access/home/steve/perlstuff>
Steve Potter http://www3.sympatico.ca/steven.potter/

In reply to Re: Re: LWP::UserAgent destroys $response->content >:{ by SPotter
in thread LWP::UserAgent destroys $response->content >:{ 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.