Class: Etl::Integrations::Core::HttpClient

Inherits:
Object
  • Object
show all
Defined in:
lib/etl/integrations/core/http_client.rb

Class Method Summary collapse

Class Method Details

.request(url, method, payload: nil, headers: {}) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/etl/integrations/core/http_client.rb', line 7

def request(url, method, payload: nil, headers: {})
  uri = URI(url)
  http = Net::HTTP.new(uri.host, uri.port)
  http.use_ssl = (uri.scheme == "https")
  request = build_request(method, uri, payload, headers)
  http.request(request)
end