Method: Conductor::Connection#put

Defined in:
lib/nf-conductor/http/connection.rb

#put(url, args = {}) ⇒ Object



41
42
43
44
45
46
47
48
49
50
# File 'lib/nf-conductor/http/connection.rb', line 41

def put(url, args={})
  Rails.logger.info("Conductor::Connection : PUT #{url} with args #{args}") if Conductor.config.verbose
  connection.put do |req|
    req.url url
    req.headers['Content-Type'] = ( args[:headers] && args[:headers]['Content-Type'] || 'application/json' )
    req.body = args[:body] if args[:body]
  end
rescue Faraday::ParsingError
  Struct.new(:status, :body).new(500, 'Conductor::Connection : Faraday failed to properly parse response.')
end