Class: Cloudmunda::API::Client
- Inherits:
-
Object
- Object
- Cloudmunda::API::Client
- Defined in:
- lib/cloudmunda/api/client.rb
Class Method Summary collapse
Class Method Details
.content_headers ⇒ Object
22 23 24 25 26 |
# File 'lib/cloudmunda/api/client.rb', line 22 def self.content_headers { 'Content-Type': 'application/json' } end |
.headers ⇒ Object
16 17 18 19 20 |
# File 'lib/cloudmunda/api/client.rb', line 16 def self.headers { authorization: "Basic #{Base64.strict_encode64("#{Cloudmunda.client_id}:#{Cloudmunda.client_secret}")}" } end |
.post(url, params = {}) ⇒ Object
11 12 13 14 |
# File 'lib/cloudmunda/api/client.rb', line 11 def self.post(url, params = {}) response = RestClient.post(url, params.to_json, headers.merge(content_headers)) JSON.parse(response.body) end |