Method: PlatformLib::WebHelper.put

Defined in:
lib/platform_lib/web_helper.rb

.put(uri, body) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/platform_lib/web_helper.rb', line 23

def self.put(uri, body)
  http = Net::HTTP.new(uri.host, uri.port)
  if uri.scheme == "https"
    http.use_ssl = true
  end

  request = Net::HTTP::Put.new(uri.request_uri)
  request.content_type = "application/json"
  request.body = body
  
  http.request(request)
end