in reply to How can i simulate a form post using sockets?
i think this might just work... (i will keep my fingers crossed)
the thing is to connect to port 80 and do simple HTTP requests.......
the print statement prints the request to directly to the socket and then it is directly read from the socket
you can even loop indefinitely if you want..... giving an terminating condition....
$host is the IP address of the required hostuse IO::Socket; use strict; my $socket=new IO::Socket( PeerAddr=>$host, PeerPort=>80, #HTTP Proto=>'tcp', ) or die "cannot create socket\n"; #print the input to the socket print $socket "<your get command here">; #read the input from the socket my $data=<$socket>; print $data; print $socket "<your post command here>"; close $socket
the thing is to connect to port 80 and do simple HTTP requests.......
the print statement prints the request to directly to the socket and then it is directly read from the socket
you can even loop indefinitely if you want..... giving an terminating condition....
|
---|
In Section
Seekers of Perl Wisdom