Class: ProconBypassMan::HttpClient::HttpRequest::Post

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



13
14
15
16
17
# File 'lib/procon_bypass_man/support/http_client.rb', line 13

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