473,385 Members | 1,829 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

501 Protocol scheme '' is not supported error when using LWP

hi

I'm trying to use the example here:
http://search.cpan.org/~gaas/libwww-....pm#An_Example

here is the code:
Expand|Select|Wrap|Line Numbers
  1. use LWP::UserAgent;
  2. use LWP::Debug qw(+); 
  3.  
  4.     # Create a user agent object
  5.     my $ua = LWP::UserAgent->new;
  6.     $ua->agent("MyApp/0.1 ");
  7.  
  8.     # Create a request
  9.     my $req = HTTP::Request->new(POST => 'http://search.cpan.org/search');
  10.     $req->content_type('application/x-www-form-urlencoded');
  11.     $req->content('query=libwww-perl&mode=dist');
  12.  
  13.     # Pass request to the user agent and get a response back
  14.     my $res = $ua->request($req);
  15.  
  16.     # Check the outcome of the response
  17.     if ($res->is_success) {
  18.         print $res->content;
  19.     } else {
  20.       print $res->status_line, "\n";
  21.     }
  22.  
and here is the response:
Expand|Select|Wrap|Line Numbers
  1. LWP::UserAgent::new: ()
  2. LWP::UserAgent::request: ()
  3. LWP::UserAgent::send_request: POST http://search.cpan.org/search
  4. LWP::UserAgent::request: Simple response: Not Implemented
  5. 501 Protocol scheme '' is not supported
  6.  
what am I doing wrong? what is the meaning of the error response?
Jun 9 '10 #1
1 6637
RonB
589 Expert Mod 512MB
Try using a GET request instead of the POST request.
Jun 9 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: toufik toufik | last post by:
I've the folowing error "Call to undefined function: phtmldec() " when using a script encrypted with PHTML Here are the steps done: - I've Appache (windows XP), PHP434 - using PHTML, I've...
5
by: Andrew James | last post by:
Gentlemen, I'm running into a problem whilst testing the parsing of a language I've created with TPG . It seems that for some reason, TPG balks when I try to parse an expression whose first...
1
by: H.L Bai | last post by:
hi, everybody i meet a parse error when i used the xml4c. any proposal is helpful. The error is following .../XMLRegionHandler.h:59 parse error before '*' .../XMLRegionHandler.h:60 parse...
1
by: Dermot O'Loughlin | last post by:
Can anyone help me with this? I get the following error when using the odbc adapter wizard in VS.Net 2003: --------------------------- Wizard Form --------------------------- An unexpected...
1
by: Richard | last post by:
I keep getting this error and i dont know how 2 fix it. If someone knows how, please tell me :D Compilation Error Description: An error occurred during the compilation of a resource required to...
0
by: Charlie | last post by:
Hi: I get a TreeNode binding error when using Data property of XmlDataSource control. When I switch to TextFile property and point to xml file on hard drive, problem goes anyway. I'm...
0
by: =?Utf-8?B?TG93bGFuZGVy?= | last post by:
Hello, I've built a web application that uses client script callbacks. It is used on a large network with a large variety of user OSes and IE versions. It was tested on IE 6 on different setups...
2
by: pillappa | last post by:
Hi, I am hitting this error consistently and don't know why it's happening. I would like to define all exceptions for my project in one file and use them across the project. Here's a sample - ...
8
by: msnews.microsoft.com | last post by:
Our IT team relocated our application servers yesterday. They had to take one machine out of the cluster because it would prompt users for credentials if accessed using the IP address, which I...
7
by: svsenthilkumar | last post by:
Hai, I got an javascript error when using ajax in mozilla browser, anyone help me why the error is coming, meaning for this error and how can i rectify this error. Error: " nsresult:...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.