General information
Category:
Internet applications
Title:
Access the response from a web site
Environment versions
Network:
Windows 2003 Server
We have a web site to validate general ledger numbers.
The url includes the site name with a parameter containing the GL number to validate.
The site returns 2 pieces of information; 0 for invalid, 1 for valid, and a brief message as to what is invalid.
Another department has provided a perl script that will capture the returned values and print them. I want to capture the return values and process them.
The perl script is:
#!/usr/local/bin/perl
use LWP;
my $webapp = "put the http:// url here";
my $mfk = "put the GL number here";
my $query = "$webapp?mfk=$mfk";
my $ua = new LWP::UserAgent;
my $request = new HTTP::Request( "GET", $query );
my $response = $ua->request( $request );
($valid, $message) = (split( /\n/, $response->content() ));
if( $valid eq "1" ) {
print "Valid! - $message\n";
} elsif( $valid eq "0" ) {
print "Invalid! - $message\n";
} else {
print "Error! - $message\n";
}
Is there a way to write this in VFP?
I have tried using hyperlink but it does not have a way to access the return value.
Thank you for your assistance.
Pamela
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only