Brian Candler wrote:
> On Sun, Apr 08, 2007 at 12:08:29AM +0900, Hey You wrote:
>> I'm trying to make a little program that goes to a page and posts your
>> username and password using a ruby socket but I don't know how to post
>> data with a socket. I only know how to get data. I googled and haven't
>> found anything so if anyone has a solution then it would be greatly
>> appreciated.
> 
> Google for "ruby Net::HTTP". Or just type "ri Net::HTTP" at the command
> line. After example #4 you'll see an example that makes a HTTP post.
> 
> Of course, if you really want to do this using a plain TCP socket, then 
> it's
> entirely up to you to send a correctly-formatted HTTP POST request and 
> to
> parse the response. You will need to read RFC 2616 if you want to do 
> that.
> 
> If what you really want is to automate interaction with a website, look 
> at
> the Mechanize library.
> 
> HTH,
> 
> Brian.

Thank you for the great response and I know how to post data with 
Net::HTTP and WWW::Mechanize is great but I wanted something more 
challenging and it seems that sockets are faster in speed. Also I'm 
sorry but I don't really understand what you mean by "send a 
correctly-formatted HTTP POST request and parse the response". I also 
googled "ruby RFC 2616" and have found this site: 
http://www.rfc-editor.org/rfc/rfc2616.txt. Is the information I'm 
looking for in that website? Sorry for all the questions :(.

-- 
Posted via http://www.ruby-forum.com/.