Class: RubyProxyHeaders::HTTPGem::ProxyClient

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_proxy_headers/http_gem.rb

Overview

HTTP.rb client that sends proxy_headers on CONNECT.

Constant Summary collapse

REQUEST_OPTIONS =
%i[open_timeout read_timeout headers body verify_ssl].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(proxy:, proxy_headers: {}, **options) ⇒ ProxyClient

Returns a new instance of ProxyClient.



45
46
47
48
49
# File 'lib/ruby_proxy_headers/http_gem.rb', line 45

def initialize(proxy:, proxy_headers: {}, **options)
  @proxy = proxy
  @proxy_headers = proxy_headers
  @default_options = options
end

Instance Attribute Details

#last_proxy_response_headers ⇒ Object (readonly)

Returns the value of attribute last_proxy_response_headers.



41
42
43
# File 'lib/ruby_proxy_headers/http_gem.rb', line 41

def last_proxy_response_headers
  @last_proxy_response_headers
end

Instance Method Details

#delete(url, **options) ⇒ Object



63
64
65
# File 'lib/ruby_proxy_headers/http_gem.rb', line 63

def delete(url, **options)
  request(:delete, url, **options)
end

#get(url, **options) ⇒ Object



51
52
53
# File 'lib/ruby_proxy_headers/http_gem.rb', line 51

def get(url, **options)
  request(:get, url, **options)
end

#post(url, body: nil, **options) ⇒ Object



55
56
57
# File 'lib/ruby_proxy_headers/http_gem.rb', line 55

def post(url, body: nil, **options)
  request(:post, url, body: body, **options)
end

#put(url, body: nil, **options) ⇒ Object



59
60
61
# File 'lib/ruby_proxy_headers/http_gem.rb', line 59

def put(url, body: nil, **options)
  request(:put, url, body: body, **options)
end