473,385 Members | 2,015 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

IO::Socket...HTTP/1.0\n\n needs to be HTTP/1.1\r\n

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
Expand|Select|Wrap|Line Numbers
  1. use IO::Socket;
  2. $first_name = 'Steve';
  3. $last_name = 'Dunn';
  4.  
  5. $sym_url = "/cgi-bin/pd.exe/search?p1=$last_name&p2=$first_name&p3=&input=grp_sxo_name&type=name&dlnumber=CC&dlstate=CC";
  6.  
  7. $socket = IO::Socket::INET->new
  8.         ( PeerAddr => 'search.criminalcheck.com',    
  9.         PeerPort => 80,  
  10.         Proto => 'tcp',  
  11.         Type => SOCK_STREAM,      
  12.         Reuse => 1)  
  13.  
  14. # this does not work:
  15. print $socket "GET $sym_url HTTP/1.0\n\n";
  16. # I think the server wants this:
  17. print $socket "GET $sym_url HTTP/1.1\r\n\n";   # BUT it doesn't wk either
  18.  
  19. while (<$socket>) {       # read in entire web page line by line
  20.         print "$_\n";
  21.     print OUT_HTML $_;        # Writes each line as it is read to the filehandle "OUT"
  22.  }
  23.  
  24.    ### done reading web page
  25.     print "\n\n----- done with web page -------\n\n";
  26.  
  27. ## for testing the URL I am using is:
  28. #http://search.criminalcheck.com/cgi-bin/pd.exe/search?p1=Dunn&p2=Steve&p3=&input=grp_sxo_name&type=name&dlnumber=CC&dlstate=CC
  29.  
Oct 9 '08 #1
1 4604
Icecrack
174 Expert 100+
First Please use code tags,

Second Change:

Expand|Select|Wrap|Line Numbers
  1. print $socket "GET $sym_url HTTP/1.1\r\n\n"
to:

Expand|Select|Wrap|Line Numbers
  1. print $socket "GET $sym_url HTTP/1.1\r\n"
Oct 10 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Rad | last post by:
Im trying to lauch a small perl program in cygwin which listens for arguments on a specified port. When executing this line (18) ; my $sock = new IO::Socket::INET(LocalPort => $DAEMONPORT,...
1
by: bobano | last post by:
Hi everyone, I am writing a POP3 Client program in Perl. You connect to a POP3 Server and have a running conversation with the mail server using commands from the RFC 1939 Post Office Protocol....
8
by: kardon33 | last post by:
Currently i am working on a project to send a UDP packet through the ArtNet protocol and receive a message back and read and output it. right now i can send the message fine and the device i send it...
1
by: kardon33 | last post by:
How would i receive an incoming UDP packet in perl with IO::SOCKET::INET???
1
by: Dimbeswar Pathak | last post by:
I got an error message "use" not allowed in expression at client.pl line 2, at end of line syntax error at client.pl line 2, near "use IO::Socket::INET" Execution of client.pl aborted due to...
0
by: clemima | last post by:
Hi, i have a script that listens on a port for simple text messages and then executes sql to a remote mssql database . The script is started via crontab . There are 2 problems : 1 . The line to...
2
by: cookspyder | last post by:
In reference to streaming data over socket: Any one know how to keep a IO socket open while sending data everytime my while loops runs and collects data the connection closes and while the loop...
4
by: pplers | last post by:
use IO::Socket; my $path= "http://website.com/aaa.php"; print q( __________ -/* Script v1.0 *\- ------------------ );
0
by: Nyoka | last post by:
Hi All, I am trying to great a webserver that works over https (443) and listens on a single ip address on a machine that has multiple ip addresses. use IO::Socket::SSL; $socket = new...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.