Subject: | Possible HTTP protocol issue - checked with ethereal |
Not sure if anyone else has the same issue. I have been really trying to
get this module to work for me. I can get LWP working with http and
https but can't get Medch to work. Used ethereal to analyse the issue
and came up with this.
With LWP I get the following:
GET / HTTP/1.1
TE: deflate,gzip;q=0.3
Connection: TE, close
Host: www-my-server
User-Agent: MyApp/0.1 libwww-perl/5.805
Result:
HTTP/1.1 200 OK
Server: Sun-ONE-Server
Date: Tue, 30 May 2006 06:43:17 GMT
Content-length: 3043
Content-type: text/html
Last-modified: Thu, 23 Mar 2006 02:42:57 GMT
Connection: close
With Mech I get the following:
GET http://www-my-server/ HTTP/1.1
TE: deflate,gzip;q=0.3
Connection: TE, close
Accept-Encoding: identity
Host: www-my-server
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
Result: Time out on proxy server. Proxy could not resolve it. I have no
access to the proxy tables so can't change that.
Here is my code
#!/usr/bin/perl -w
use strict;
use warnings;
use WWW::Mechanize;
my $url = "http://www-my-server/";
my $m = WWW::Mechanize->new();
$m->agent_alias('Windows IE 6');
$m->proxy(['http','ftp'], 'http://proxy:8080/');
$m->get($url);
print $m->content;
comments:
LWP issues the command "GET /" while Mech issues the command
"GET HTTP://www-my-server/"
Why is that? Is this a bug or is it supposed to work like this? My
thoughts are that since it's a derived class it should issue the same
http protocol calls.
Thanks Digit