Sha256: 55e3cbd2a87a482d9de897ac398c4eaa5f0c29b1f8ba9eeff0f3e06753671553

Contents?: true

Size: 472 Bytes

Versions: 3

Compression:

Stored size: 472 Bytes

Contents

module Assertiva
  module Requests
    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
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
assertiva-0.2.2 lib/assertiva/requests.rb
assertiva-0.2.1 lib/assertiva/requests.rb
assertiva-0.2.0 lib/assertiva/requests.rb