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

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

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


New User

Jul 16, 2009, 11:47 AM

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


I am trying to execute a perl script form my server with command

/usr/local/bin/perl /home/wlnprov/etc/Netcon_SOPMDD/ -url -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.

Thank you

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
print "$url is down.\n";
$message1 = $response->content();
print "$message1 .\n"


Jul 16, 2009, 12:22 PM

Post #2 of 2 (1002 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