Hey Vijay, On Thu, Mar 26, 2009 at 8:19 PM, Vijay <[email protected]> wrote: > Hi, > I think I may have just found out the reason I was having trouble with > net:HTTP on my machine. I am running mac os 10.5.6 and the shoes version is > 0.r1134. > I have a jetty server running at localhost, port 8080. > Consider the following shoes sample > > require 'net/http' > Shoes.app{ > para Net::HTTP.get URI.parse('http://127.0.0.1:8080') <--- 1 > para "\n" > para Net::HTTP.get URI.parse('http://localhost:8080') <-- 2 > } > > If you run load this sample with shoes application, you will get a result > [in this case jetty's default page] for line 1. Executing line 2 makes shoes > throw up a 'Connection refused ' error in console. It seems to me that > 'localhost' is not getting resolved correctly. > > I am attaching a screen shot of the console with this mail. > > Regards, > Vijay > > PS - I have an earlier post titled 'help with http post in shoes' > mentioning similar issue
Try Shoes' download() method. It uses native libraries for async operation and provides a nice interface for handling success, error and other states of the request/response cycle. This simple example worked for me: Shoes.app do download "http://localhost:3000" do |d| para d.response.body end end http://help.shoooes.net/App.html#download -- Seth Thomas Rasmussen http://greatseth.com
