Class: ProconBypassMan::HttpClient::HttpRequest::Put

Inherits:
Object
  • Object
show all
Defined in:
lib/procon_bypass_man/support/http_client.rb

Class Method Summary collapse

Class Method Details

.request!(uri:, request_body: {}) ⇒ Object



21
22
23
24
25
# File 'lib/procon_bypass_man/support/http_client.rb', line 21

def self.request!(uri: , request_body: {})
  http = Net::HTTP.new(uri.host, uri.port)
  http.use_ssl = uri.scheme === "https"
  http.put(uri.path, request_body.to_json, { "Content-Type" => "application/json" })
end