Class: RubyProxyHeaders::HTTPGem::ProxyClient

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

Overview

Proxy client wrapper for HTTP.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of ProxyClient.



37
38
39
40
41
42
# File 'lib/ruby_proxy_headers/http_gem.rb', line 37

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

Instance Attribute Details

#last_proxy_response_headersObject (readonly)

Returns the value of attribute last_proxy_response_headers.



44
45
46
# File 'lib/ruby_proxy_headers/http_gem.rb', line 44

def last_proxy_response_headers
  @last_proxy_response_headers
end

Instance Method Details

#delete(url, **options) ⇒ Object



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

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

#get(url, **options) ⇒ Object



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

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

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



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

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

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



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

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