Class: Facebook::AccountKit::HTTP

Inherits:
Object
  • Object
show all
Defined in:
lib/facebook/account_kit/http.rb

Class Method Summary collapse

Class Method Details

.get(url) ⇒ Object

Raises:



9
10
11
12
13
14
15
# File 'lib/facebook/account_kit/http.rb', line 9

def self.get(url)
  response = Net::HTTP.get_response url
  parsed_response = JSON.parse(response.body)
  raise InvalidRequest, parsed_response['error']['message'] if response.code != '200'

  parsed_response
end