|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I am trying to use LWP to fetch a file from the net and i keep on getting "Error: 500 Can't connect to proxy.bstoke.uk.ibm.com:80 (Timeout)" can any one help heres the code:
use LWP::UserAgent; $ua = LWP::UserAgent->new; $ua->timeout(600); $ua->env_proxy; $ua->agent("Mozilla/8.0"); # pretend we are very capable browser $req = HTTP::Request->new(GET => 'http://www.pc.ibm.com/partner/uk/index.html'); $req->header('Accept' => 'text/html'); # send request $res = $ua->request($req); # check the outcome if ($res->is_success) { print $res->content; } else { print "Error: " . $res->status_line . "\n"; } |
|
#2
|
|||
|
|||
|
May not be your script. Or perhaps there is restricted access to that website.
__________________
- dsb - ![]() Perl Guy |
|
#3
|
|||
|
|||
|
Thanks i have resolved the issue now and its working fine.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Perl Programming > LWP headaches |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|