Module: Falconz::REST::POST

Included in:
Client
Defined in:
lib/falconz/rest/post.rb

Instance Method Summary collapse

Instance Method Details

#post_request(path, json: false, **options) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/falconz/rest/post.rb', line 4

def post_request(path, json: false, **options)
  response = HTTParty.post(url + path, 
                          headers: header,
                          body: options)
  if response.success?
    return response.body if json
    return response
  else
    raise RuntimeError, response.to_h
  end
end