I can not use the LWP module, and must use IO::Socket. Using 'Wireshark' and Mozilla and passing in the parameters below I get a valid reply. However Wireshark shows HTTP needs to be 1.1 and that the Internet line terminator needs to be "\r\n" and not "\n\n". How do I get IO::Socket to use the 1.1 Protocol? Also, how do I get Perl to indicate it is a Mozilla browser? I have been Googling this for several hours and am unable to find anything of use. Any help is appreciated. John
-
use IO::Socket;
-
$first_name = 'Steve';
-
$last_name = 'Dunn';
-
-
$sym_url = "/cgi-bin/pd.exe/search?p1=$last_name&p2=$first_name&p3=&input=grp_sxo_name&type=name&dlnumber=CC&dlstate=CC";
-
-
$socket = IO::Socket::INET->new
-
( PeerAddr => 'search.criminalcheck.com',
-
PeerPort => 80,
-
Proto => 'tcp',
-
Type => SOCK_STREAM,
-
Reuse => 1)
-
-
# this does not work:
-
print $socket "GET $sym_url HTTP/1.0\n\n";
-
# I think the server wants this:
-
print $socket "GET $sym_url HTTP/1.1\r\n\n"; # BUT it doesn't wk either
-
-
while (<$socket>) { # read in entire web page line by line
-
print "$_\n";
-
print OUT_HTML $_; # Writes each line as it is read to the filehandle "OUT"
-
}
-
-
### done reading web page
-
print "\n\n----- done with web page -------\n\n";
-
-
## for testing the URL I am using is:
-
#http://search.criminalcheck.com/cgi-bin/pd.exe/search?p1=Dunn&p2=Steve&p3=&input=grp_sxo_name&type=name&dlnumber=CC&dlstate=CC
-