Phil Thompson <[EMAIL PROTECTED]> writes: > >There is actually no easy way to do that. They are inserted by the > >protocol module when it feels they are appropriate. Can you explain > >why you need them to to go away? > > I need them to go away because I want Perl to look just like an > application that normally requests the data I'm looking for. The app > doesn't write "Connection" or "TA" headers, so I don't want Perl to > write them either. After all, why bother spoofing a user-agent > string if you proceed to send some other headers that immediately > fingerprint you as a perl script?
So you are not on friendly terms with the server you are trying to access then. Oh well,... > >The "Connection: close" will go away of you pass the keep_alive option > >to the LWP::UserAgent. If you insist hard on the "TE" header to be > >disabled you you try something like: > > > > push(@LWP::Protocol::http::EXTRA_SOCK_OPTS, SendTE => 0); > > > >before you send your first request. > > Thanks! That succeeded in nuking the "TA" header. But, I'm still > getting the "Connection" header when I use: my $ua = > LWP::UserAgent->new(keep_alive => 1); > > I've simply managed to change the "Connection: close" into > "Connection: Keep-Alive". > > Any advice, or am I stuck? Seems like you can try to push (PeerHTTPVersion => "1.1") onto the @EXTRA_SOCK_OPTS to supress this one as well. > ps. I also looked at Net::HTTP as a lower-level option for what I'm > doing, but I need the proxy feature from LWP::UserAgent. It's no problem taking to a proxy with Net::HTTP, but it is certainly easier to use LWP::UserAgent. Regards, Gisle