Class: Launchrock::Connection

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/launchrock/connection.rb

Direct Known Subclasses

Client, Site

Defined Under Namespace

Classes: ApiError

Class Method Summary collapse

Class Method Details

.perform_post(uri, body) ⇒ Object



6
7
8
9
10
11
12
13
# File 'lib/launchrock/connection.rb', line 6

def self.perform_post(uri, body)
  resp = HTTParty.post("#{base_uri}#{uri}", { :body => body }).first['response']

  unless resp['status'] == 'OK'
    raise ApiError, "API Call Failed" 
  end
  resp
end