in reply to User-Agent
Now yahoo no longer complains about received a bad request.use IO::Socket; $sock = new IO::Socket::INET ( PeerAddr => 'www.yahoo.com', PeerPort => 80, Proto => 'tcp', Timeout => 10, ); die "Socket could not be created $!\n" unless $sock; print $sock "GET /page?pg=somewhere.html HTTP/1.0\nUser-Agent: Mozill +a/4.0 (compatible; MSIE 5.01; Windows 98; ocnie5-1)\nContent-Type: te +xt/html; charset=EUC-JP\n\n"; while($line = <$sock>) { print "$line\n"; } exit 0;
|
|---|