Those very docs say "And if you need to go beyond these, you can always break out Ruby's OpenURI class."... Does shoes hack open-uri to go via download, or is this some strange cyclical thing where the docs are advising that if download doesn't work we should be using Net::HTTP in a round about way?

On 12/03/2009, at 2:56 PM, _why wrote:

On Wed, Mar 11, 2009 at 05:31:36PM -0700, Vijay wrote:
I have a strange problem with using ruby http post in shoes block. I get a
connection refused - connect(2) error on trying to run the shoes app.
I am running the program on macOS and the problem seems to be
resolve-replace.rb: line 19.

I would stay away from Net::HTTP when using Shoes. It's a blocking
operation. Your whole app will stop until the request is done.

Use the `download` method, which can do HTTP in the background
and uses platform-specific code to work much, much faster.


 Shoes.app do
   download "http://localhost:8080";, :method => "POST",
            :body => "userName=user&password=11111" do |dl|
     para dl.response.body
   end
 end

You can read more in the Shoes manual.
http://help.shoooes.net/App.html#download

_why

Reply via email to