Module: FreshmailApi::Client
- Included in:
- FreshmailApi
- Defined in:
- lib/freshmail_api/client.rb
Constant Summary collapse
- ENDPOINT =
'https://api.freshmail.com'
Instance Method Summary collapse
Instance Method Details
#perform(method, path, data = {}) ⇒ Object
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/freshmail_api/client.rb', line 6 def perform(method, path, data={}) data = parse_data(data) path = "/rest/#{path}" response = client.send(method, path) do |request| request.headers = headers(path, data) request.body = data if method == :post end JSON.parse(response.body) end |