Module: Assertiva::Requests
- Defined in:
- lib/assertiva/requests.rb
Class Method Summary collapse
Class Method Details
.post(path, params = {}) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/assertiva/requests.rb', line 3 def self.post(path, params={}) raise NoApiKey unless Assertiva.api_key headers = { authorization: Assertiva.api_key, accept: "application/json;charset=UTF-8", content_type: "application/json;charset=UTF-8" } url = Assertiva.base_url + path begin response = RestClient.post(url, params.to_json, headers) rescue => e raise end end |