Jul 16, 2009, 11:47 AM
Post #1 of 2
501 HTTP not supported
I am trying to execute a perl script form my server with command
/usr/local/bin/perl /home/wlnprov/etc/Netcon_SOPMDD/sample.pl -url http://188.8.131.52:5960 -file "batch.xml" -u a -p b
which give me the error
501 Protocol scheme 'http' is not supported
LWP is installed correctly I believe , testing of the below command gives me correct version, gives some error when not installed properly.
bash-2.05$ /usr/local/bin/perl -MLWP -le "print(LWP->VERSION)"
Where as the same command and the perl script is working fine from a different server a development server
and I am trying to deploy in live enviornment.
I have checked with the infrastructure guys and confirmed that the port opening is not an issue.
use lib "/usr/local/lib/perl5/5.8.5";
# An example URL would be http://localhost:5960/xml/
$url = '';
$file = '';
# These are normal NetConductor user names and passwords.
$user = '';
$pass = '';
GetOptions('url=s' => \$url, 'file=s' => \$file, 'u=s' =>\$user, 'p=s' =>\$pass);
die "Please specify a url.\n";
#print "Please specify a url.\n";
#die "Please specify a file.\n";
print "Please specify a file.\n";
#die "Please specify a user name.\n";
print "Please specify a user name.\n";
# Performs the POST action
$ua = new LWP::UserAgent;
$response = $ua->request(POST $url,Content_Type=>'form-data',Content=>[user=>$user,pass=>$pass,file=>["$file"]]);
# Prints the response from the server
$message = $response->content();
print "$message .\n"
# This prints an error message if the script was unable to connect to the URL
print "$url is down.\n";
$message1 = $response->content();
print "$message1 .\n"