Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: How can i simulate a form post using sockets?

by hnd (Scribe)
on Jun 29, 2009 at 21:18 UTC ( #775822=note: print w/ replies, xml ) Need Help??


in reply to How can i simulate a form post using sockets?

i think this might just work... (i will keep my fingers crossed)

use 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
$host is the IP address of the required host
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....


Comment on Re: How can i simulate a form post using sockets?
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://775822]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (8)
As of 2014-10-25 15:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (145 votes), past polls