Method: Frontapp::Client#create

Defined in:
lib/frontapp/client.rb

#create(path, body) ⇒ Object



107
108
109
110
111
112
113
114
# File 'lib/frontapp/client.rb', line 107

def create(path, body)
  res = @headers.post("#{base_url}#{path}", json: body)
  response = JSON.parse(res.to_s)
  if !res.status.success?
    raise Error.from_response(res)
  end
  response
end