I have a cgi script that accepts parameters from a 'get' post via a web form. The cgi script then sends the parameters as a POST request to an external applicaton. The cgi script then recieves a response from the external application (content-type=text/plain), puts it into a string and displays it on the web page.
CGI code below;
#!/usr/bin/perl
use LWP::UserAgent;
$ua = LWP::UserAgent->new;
my $req = HTTP::Request->new(POST => '$req->content_type('application/x-$req->content($ENV{QUERY_STRING});
my $res = $ua->request($req);
$result = $res->as_string;
print("Location: ../test2.asp?result=$result\n\n"
exit;
---------
What i want to be able to do is to test the response I get back with a substitute for the external application. For instance another cgi on our server... just to make sure that our script is recieveing a response ok.
Bit stumpted.
Any help gratefully recieved.
Nell1
CGI code below;
#!/usr/bin/perl
use LWP::UserAgent;
$ua = LWP::UserAgent->new;
my $req = HTTP::Request->new(POST => '$req->content_type('application/x-$req->content($ENV{QUERY_STRING});
my $res = $ua->request($req);
$result = $res->as_string;
print("Location: ../test2.asp?result=$result\n\n"
exit;
---------
What i want to be able to do is to test the response I get back with a substitute for the external application. For instance another cgi on our server... just to make sure that our script is recieveing a response ok.
Bit stumpted.
Any help gratefully recieved.
Nell1