fourmi has asked for the wisdom of the Perl Monks concerning the following question:
Emulate a request from my machine as much as possibe, I have already sorted the user agent side, but the other are causing confusion, Ideally i would like to set the followingsub GetURL { my ($inURL) = @_; my ($ua, $request, $response); $ua = new LWP::UserAgent; $ua->agent('Mozilla/4.0 (compatible; MSIE 5.22;Mac_PowerPC)'); $request = new HTTP::Request 'GET', $inURL; $response = $ua->request($request); if ($response->is_success) { return $response->content; } else { return $response->error_as_HTML; } }
does any know how i go about setting these? The HTTP_TE seems to be set by default, so it is already set, but how would i modify it all the same?HTTP_ACCEPT = */* HTTP_ACCEPT_LANGUAGE = en HTTP_CONNECTION = Keep-Alive HTTP_EXTENSION = Security/Remote-Passphrase HTTP_UA_CPU = PPC HTTP_UA_OS = MacOS HTTP_TE = deflate,gzip;q=0.3
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: LWP config
by Corion (Patriarch) on Mar 12, 2004 at 12:29 UTC | |
by fourmi (Scribe) on Mar 12, 2004 at 12:41 UTC |