Check the LWP doc at 
http://www.perldoc.com/perl5.6.1/lib/LWP/UserAgent.html 

You must use something like the following. 


  use LWP::UserAgent;  
  
  $ua = LWP::UserAgent->new;
  
  #$ua->env_proxy; # initialize from environment variables
  # or
  
  $ua->proxy(http  => 'http://myproxy.mydomain.com:8080');
  #$ua->proxy(ftp  => 'http://proxy.myorg.com');
  #$ua->proxy(wais => 'http://proxy.myorg.com');
  #$ua->no_proxy(qw(no se fi));

  my $req = HTTP::Request->new(GET => 'http://www.ibm.com/');
  print $ua->request($req)->as_string;


# To use env. Variables, here are the DOS shell commands : 
#set HTTP_proxy=http://myproxy.mydomain.com:8080
#set HTTP_proxy_user=myusername
#set HTTP_proxy_pass=mypassword


_____________________________________________
Bruno Bellenger
Sr. Network/Systems Administrator 


        -----Original Message-----
        From:   [EMAIL PROTECTED]
[SMTP:[EMAIL PROTECTED]]
        Sent:   Tuesday, August 27, 2002 2:07 PM
        To:     [EMAIL PROTECTED];
[EMAIL PROTECTED];
[EMAIL PROTECTED]
        Cc:     [EMAIL PROTECTED]
        Subject:        RE: LWP and ASP Pages

        No.  Staying behind a corporate firewall.

        Stanley G. Martin
        Sprint - ISS Enterprise App/Decision Support Services 
        [EMAIL PROTECTED]


        -----Original Message-----
        From: BelleBru [mailto:[EMAIL PROTECTED]]
        Sent: Tuesday, August 27, 2002 7:04 AM
        To: perl-win32-users; perl-win32-web
        Cc: Stanley.G.Martin
        Subject: RE: LWP and ASP Pages



              Your script works just fine when the missing quote 
              is restored in 
              $filename  = "D:\\temp\\msi.html" ; 

              Of course, this is true on an intranet. 
              You don't need to go through any proxy to reach the target
server,
        are you ? 

        _____________________________________________
        Bruno Bellenger
        Sr. Network/Systems Administrator 

              -----Original Message-----
              From: [EMAIL PROTECTED]
        [SMTP:[EMAIL PROTECTED]]
              Sent: Monday, August 26, 2002 4:40 PM
              To:   [EMAIL PROTECTED];
        [EMAIL PROTECTED]
              Subject:    LWP and ASP Pages

              I'm trying to test to make sure my web site is up by
connecting to
        the
              admin web page of my application.  The admin web page is an
ASP
        page
        and
              whenever I set it up using:

              use HTTP::Request;
              use LWP::UserAgent;

              $filename  = D:\\temp\\msi.html";

              $ua = LWP::UserAgent->new;
              $url = "http://webserver/admin.asp";;
              $req = new HTTP::Request (GET => $url);
              $res = $ua->request($req, $filename);
              if ($res->is_success) {
                  print "Got response back from web page\n";
              } else {
                  print "No response from web page.\n";
                  exit;
              }

              It always fails.  I can take the URL and plug it into a
browser
        and
        it
              comes up just fine.  Any ideas???


              Stanley G. Martin
              Sprint - ISS Enterprise App/Decision Support Services 
              [EMAIL PROTECTED]
              

        

_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to