Click here to get back home

LWP problems

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
LWP problems Mike 07-11-2005
Posted by Mike on July 11, 2005, 3:50 pm
Please log in for more thread options


I'm trying to touch IBM from inside a proxy. My LWP code touches the proxy,
but does not authenticate with the proxy so I can go on to IBM. Does anyone
see my mistake?

Thanks

Mike

Here is the code:


#!/usr/bin/perl

# $Id$
# $Log$

# grab the machine type from 'lsattr -El sys0'
# grab the current microcode version depending on the command for that machine
# grab the latest microcode version for this box from:
# http://techsupport.services.ibm.com/server/mdownload/download.html
# complain if the microcode is not at the current version

use LWP::UserAgent;
use LWP::Debug qw(+);
use strict;

# globals
my $microcodeurl =
'http://techsupport.services.ibm.com/server/mdownload/download.html';

# get the machine type
my $cmd = 'lsattr -El sys0 | grep modelname';
open(IN, "$cmd |") or die "$0: cannot execute '$cmd': $!";
my $line = <IN>;
close(IN);
chomp($line);

# pull the microcode version from IBM
# and the command to get the currently installed microcode version
my $ua = LWP::UserAgent->new();
$ua->proxy('http', 'http://txisa002.ttiinc.com:8080');
my $req = HTTP::Request->new(GET => $microcodeurl);
my $user = 'domain\user';
my $pass = 'password';
$req->proxy_authorization_basic($user, $pass);
my $page = $ua->request($req)->as_string;
1;



Similar ThreadsPosted
Problems using GD.pm January 8, 2005, 8:05 pm
Problems when using Net::MSN 1.022 May 4, 2005, 1:20 pm
PPM Problems on Win.XP November 5, 2007, 4:26 pm
LWP Problems (Authentication?) September 5, 2004, 7:12 am
Net::FTP mdtm problems December 14, 2004, 11:00 pm
Problems with Parse::Lex May 5, 2005, 8:22 pm
DBI_DB2 problems June 2, 2006, 5:24 pm
CGI.pm: encoding problems June 9, 2006, 10:53 am
Test::Pod problems March 3, 2007, 1:04 am
problems with Date-Calc July 8, 2004, 3:09 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap