I'm using the HTTParty gem to post a request on another website of mine. In my dedicated class I define some defaults according to HTTParty's documentation:
require 'httparty'
class Notifier
include HTTParty
base_uri "my_awesome_site.com"
basic_auth "an_awesome_client", "megasecretkey"
...
end
Then within such class I have my notify
method posting the actual request:
def notify
...
result = HTTParty.post( '/receiver.json',
:query => some_message_of_mine_as_a_hash)
...
end
Everything seems to be set up correctly, yet the connection fails. Debugging the method I find out that at the moment of the request HTTParty's default_options
Hash is empty.
What's going on?