CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
501 HTTP not supported

 



seoulsoul
New User

Jul 16, 2009, 11:47 AM

Post #1 of 2 (491 views)
501 HTTP not supported Can't Post

Hi,

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://97.253.80.32: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)"
5.805


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.

Thank you





Sample.pl



#!/usr/local/bin/perl
use lib "/usr/local/lib/perl5/5.8.5";
use Getopt::Long;
use LWP::UserAgent;
use HTTP::Request;
use HTTP::Request::Common;

# 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);
if (!$url)
{
die "Please specify a url.\n";
#print "Please specify a url.\n";
}

if (!$file)
{
#die "Please specify a file.\n";
print "Please specify a file.\n";
}

if (!$user)
{
#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"]]);
#print $response->content();
#print "\n";
# Prints the response from the server
if ($response->is_success)
{
$message = $response->content();
print "$message .\n"
}

# This prints an error message if the script was unable to connect to the URL
else
{
print "$url is down.\n";
$message1 = $response->content();
print "$message1 .\n"
}
exit(1);


KevinR
Veteran


Jul 16, 2009, 12:22 PM

Post #2 of 2 (489 views)
Re: [seoulsoul] 501 HTTP not supported [In reply to] Can't Post

Is there a firewall? It seems the HTTP protocol is being blocked, which may have nothing to do with your script.
-------------------------------------------------

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives