Jim Menard wrote:

> I'm having a problem with HTTP POST under Ruby 1.6.4 and 1.6.5.
> The code
> 
>     data = "?hello=world"
>     Net::HTTP.start(HOST, PORT) { | http |
> 	response, = http.post2(PATH, data)
> 	puts response.body
>     }
> 
> always prints an empty body. The response['content-type'] is what I expect
> ("text/html"). However, GET works. When I execute the following code, I see
> the expected response body text.
> 
>     data = "?hello=world"
>     Net::HTTP.start(HOST, PORT) { | http |
> 	response, = http.get2(PATH + data)
> 	puts response.body
>     }
> 
> I know that the Net::HTTP module is under transition. Is this expected
> behavior?
> 
> Jim
> 

Jim,

Could it be that the server program you're sending this to is getting 
confused by the data you're sending in the post?  You shouldn't need, 
for example, the "?" preceding your key/value pairs.

Chad