Method: PCO::API::Endpoint#post

Defined in:
lib/pco/api/endpoint.rb

#post(body = {}) ⇒ Object



53
54
55
56
57
58
59
60
# File 'lib/pco/api/endpoint.rb', line 53

def post(body = {})
  @last_result = @connection.post(@url) do |req|
    req.body = body.to_json
  end
  _build_response(@last_result)
rescue Errors::TooManyRequests => e
  _retry_after_timeout?(e) ? retry : raise
end