Class: CloudFormation::Bridge::HttpBridge

Inherits:
Object
  • Object
show all
Defined in:
lib/cloud_formation/bridge/http_bridge.rb

Class Method Summary collapse

Class Method Details

.put(url, data) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/cloud_formation/bridge/http_bridge.rb', line 14

def put(url, data)
  connection = Faraday.new do |f|
    f.request :json
    f.request :curl, Util::LOGGER , :info
    f.request :retry, max: 2, interval: 0.05, interval_randomness: 0.5, backoff_factor: 2

    f.response :raise_error
    f.response :json, content_type: /javascript|json/

    f.adapter :typhoeus
  end

  response = connection.put(url, data, 'Content-Type' => '')

  Util::LOGGER.info("S3 response was #{response.inspect}")

  response
end