Question

I'm trying to post something to an HTTPS resource, but it seems it doesn't work.

My code look something like this:

require 'httparty'   
class MyClass
    include HTTParty
    base_uri "https://mydomain.com:8085/search"
    basic_auth 'admin', 'changeme'
    format :xml
    def mymethod
      self.class.post('/job', :query => {:search => "*"})
    end
end

As you can see, I've defined an URI with 'https' included, so it should set the use_ssl property for the Net::HTTPS library automatically. For some reason, Net::HTTP is requested, and I never get in touch with the server, so I end up with an EOF.

Any clues?

Was it helpful?

Solution

As read at http://railstips.org/blog/archives/2008/07/29/it-s-an-httparty-and-everyone-is-invited/

"HTTPS is in. If the uri has port 443 it automatically turns https on."

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top