Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
Size: Mime:
module ActionSprout::Facebook
  class HTTPService
    def get(url, options, graph)
      httparty_response = HTTParty.get(url, options)
      headers = headers_from_httparty httparty_response
      Response.new httparty_response.code, httparty_response.parsed_response, headers, graph
    end

    def post(url, options, graph)
      Response.from_httparty_response HTTParty.post(url, options), graph
    end

    private

    def headers_from_httparty(httparty_response)
      headers_hash = httparty_response.headers.to_h
      headers_hash.each_with_object({}) do |(key, val), object|
        object[key] = val.first
      end
    end

  end
end