Module: PostOverride

Defined in:
lib/right_api_client/client.rb

Overview

This is used to extend a temporary local copy of the client during login. It overrides the post functionality, which in turn creates a new instance of RestClient::Request

which is then extended to override log_request to keep creds from getting into our logs.

Instance Method Summary collapse

Instance Method Details

#post(payload, additional_headers = {}, &block) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
# File 'lib/right_api_client/client.rb', line 20

def post(payload, additional_headers={}, &block)
  headers = (options[:headers] || {}).merge(additional_headers)
  requestor =  ::RestClient::Request.new(options.merge(
    :method => :post,
    :url => url,
    :payload => payload,
    :headers => headers)
  )
  requestor.extend(LogOverride)
  requestor.execute(&block)
end