From: Nathan Taylor Date: 2006-12-30T03:29:17+09:00 Subject: Re: how to properly format data when using TCPSocket.send() Robert Klemme wrote: > On 29.12.2006 18:44, Nathan Taylor wrote: >> /puttest.html HTTP/1.0\r\nHost: #{i}\r\nConnection: >> close\r\nContent-type: text/html\r\nContent-Length: >> 309\r\nSee Spot Run!See Spot >> Run!See Spot Run!\r\n\r\n", 0) > > You need "\r\n\r\n" to separate the header from the body. Your code > shows just a single pair. > > Btw, why don't you use Net::HTTP? > > robert I tried using "\r\n\r\n", but I'm still having some problems due to the way the HTTP protocol uses multiple TCP sessions and my lack of understanding on how to handle that with Net::TCPSocket. Looks I will have to use Net:HTTP. I am new to OO programming, and I don't quite understand this portion of the Net::HTTP::Put documentation. Constants METHOD = 'PUT' REQUEST_HAS_BODY = true RESPONSE_HAS_BODY = true I know that I should be passing a URI and some content to include in the "PUT" request but I do not see any explanation of how to do that. How do I know what parameters this class accepts? -- Posted via http://www.ruby-forum.com/.