Module: AgentClient::Request

Included in:
Agent, Agent, Segment
Defined in:
lib/agent_client/request.rb

Overview

Wrapper around HTTP.request that parses the response and raises on error

Instance Method Summary collapse

Instance Method Details

#get(*args) ⇒ Object



21
22
23
# File 'lib/agent_client/request.rb', line 21

def get(*args)
  request(:get, *args)
end

#post(*args) ⇒ Object



25
26
27
28
29
30
31
32
33
# File 'lib/agent_client/request.rb', line 25

def post(*args)
  result = request(:post, *args)

  if result['meta'] && result['meta']['errorMessage']
    raise result['meta']['errorMessage']
  end

  result
end