Hi Wiggins,

I wrote a simple script that is sending a request to
localhost and receiving the response with LWP.
As I am trying to run the script it is ending up with
the error " 403 Forbidden ". I am sending the script
along with this mail bellow.

I've checked the file permission of file3.cgi and put
it to "-rwxrwxrwx".

Could you please suggest me what and where I am making
the mistake, and what should I do to overcome the
error.

with regards
Soumyadeep

The environment I am working with is :
Linux Red Hat 7.3
Apache web server
perl 5.6.1

The script sending a request to the server:

#!/usr/bin/perl
use warnings;
use strict;

use LWP::UserAgent;

use LWP;
my $ua = new LWP::UserAgent;
my $req = new HTTP::Request POST =>
'http://localhost/cgi-bin/file3.cgi';
$req->content_type('application/x-www-form-urlencoded');
$req->content('st=hi');
my $res = $ua->request($req);


if($res->is_success){
print $res->content;
}else{
print "Error: ".$res->status_line."\n";
}

exit;

Script receiving the request and sending the response
to the client:

#!/usr/bin/perl -w

  use CGI;

  print "Content-type:text/plain\n\n";

  $query = new CGI;

  $str = $query->param('st');

  print "here the string is : $str\n";



--- Wiggins d'Anconia <[EMAIL PROTECTED]> wrote:
> Soumyadeep nandi wrote:
> > Hi All,
> 
> > So, I have two plans to work out the situation,
> these
> > are as follows:
> > 
> > 1. With LWP perl module.
> > 
> >  First I will make a perl script that will put  
> the
> > request to the server.
> > 
> >  A CGI script in the server receive the request
> and
> > will run some system commands and prints the
> output
> > file as a response.
> > 
> >  Again the perl file on client site will receive
> the
> > response as a html page and parse the html to text
> > file.
> > 
> 
> Sounds reasonable assuming the overhead of a web
> connection is 
> acceptable and the other requirements meet the
> design goals.
> 
> > 2. The other one is IO::Socket::INET perl module.
> > 
> >  A perl script in both ends (i.e. client and
> server)
> > will receive and response the requests.
> > 
> > Now, what is bothering me in this regard, is as
> > follows..
> > 
> > Which way will be the better way for my work? So
> that
> > I can reduce the over heads and time (probably the
> > second one). If I need to work with the second
> option
> > what should be my steps?
> > 
> 
> The overhead could be less, but items of security,
> stability, etc. creep 
> in, but these are project specific requirements.
> 
> Since I have it on the brain these days and have
> found it very pleasant 
> to work with you might want to check out the POE
> modules/system, etc. 
> though it may be overkill for your project, hard to
> say with limited 
> information. Documentation can be found at:
> 
> http://poe.perl.org
> 
> If nothing else it might give you some more
> information about 
> client/server programming in Perl, and design
> problems you may run into.
> 
> http://danconia.org
> 

__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to