class ContentService def self.query(path, payload) MultiJson.load(RestClient::Request.execute( :method => :post, :user => config['login'], :password => config['api_key'], :url => "#{config['url']}/#{path}", :headers => { :content_type => :json, :accept => :json, :user_agent => user_agent, }, :payload => MultiJson.dump(payload) )) end private def self.config RailsConnector::Configuration.content_service end def self.user_agent @user_agent ||= ( gem_info = Gem.loaded_specs["infopark_cloud_connector"] "#{gem_info.name}-#{gem_info.version}" ) end end