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



12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/cloud_formation/bridge/http_bridge.rb', line 12

def put(url, data)
  connection = Faraday.new do |f|
    f.request :json
    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

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