From: Brian Candler Date: 2009-02-26T22:21:33+09:00 Subject: Re: Need help with Net::HTTP Post Sudhi Kulkarni wrote: > Hi, > > I am trying do a Net::HTTP post, the post returns with a 201 Created but > still the thread executing the script is stuck until Read Timeout > occurs. Need help to understand how to comeout of the Post when a > response is obtained. The code snippet I am using is as below > > fd= File.open("test.xml","rb") > h = Net::HTTP.new("", 8080) > h.post('/test/test1',fd.read) How do you know the post returns with a 201, if it isn't getting past the h.post line? Best way to find out what's going on is with tcpdump or wireshark. It's possible that there's some HTTP/1.1 nastiness going on, e.g. one side thinks the connection should remain open whilst the other thinks it should be closed, possibly combined with a missing Content-Length: header from one side or the other. -- Posted via http://www.ruby-forum.com/.