HTTPS and HTTParty - timeout and EOF

I am trying to post something to an HTTPS resource, but it seems like it is not working.

My code looks 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 defined a URI with "https" enabled, so it should automatically set the use_ssl property for the Net :: HTTPS library. For some reason, Net :: HTTP is being requested, and I will never contact the server, so I get EOF.

Any clues?

+3
source share
1 answer

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

"HTTPS is located. If uri has port 443, it automatically enables https."

+2
source

Source: https://habr.com/ru/post/1713386/


All Articles