Sha256: d1baccea4db70b4f9ea7033651ff31fab8e364c158e06fe965dcc41931e205e5
Contents?: true
Size: 590 Bytes
Versions: 9
Compression:
Stored size: 590 Bytes
Contents
# frozen_string_literal: true gem 'http' require 'http' class HttpAdapter def call(url, query, headers = {}, proxy = {}) if proxy[:host] HTTP[headers].via(proxy[:host], proxy[:port], proxy[:username], proxy[:password]) .get(url, params: query) else HTTP[headers].get(url, params: query) end end def post(url, body, headers = {}, proxy = {}) if proxy[:host] HTTP[headers].via(proxy[:host], proxy[:port], proxy[:username], proxy[:password]) .post(url, json: body) else HTTP[headers].post(url, json: body) end end end
Version data entries
9 entries across 9 versions & 2 rubygems