Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cgi response test

Status
Not open for further replies.

nell1

Technical User
Jan 8, 2003
142
GB
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top