Class: RubyProxyHeaders::HTTPGem::ProxyClient
- Inherits:
-
Object
- Object
- RubyProxyHeaders::HTTPGem::ProxyClient
- Defined in:
- lib/ruby_proxy_headers/http_gem.rb
Overview
Proxy client wrapper for HTTP.rb
Instance Attribute Summary collapse
-
#last_proxy_response_headers ⇒ Object
readonly
Returns the value of attribute last_proxy_response_headers.
Instance Method Summary collapse
- #delete(url, **options) ⇒ Object
- #get(url, **options) ⇒ Object
-
#initialize(proxy:, proxy_headers: {}, **options) ⇒ ProxyClient
constructor
A new instance of ProxyClient.
- #post(url, body: nil, **options) ⇒ Object
- #put(url, body: nil, **options) ⇒ Object
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: {}, **) @proxy = proxy @proxy_headers = proxy_headers @options = @last_proxy_response_headers = nil end |
Instance Attribute Details
#last_proxy_response_headers ⇒ Object (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, **) request(:delete, url, **) end |
#get(url, **options) ⇒ Object
46 47 48 |
# File 'lib/ruby_proxy_headers/http_gem.rb', line 46 def get(url, **) request(:get, url, **) 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, **) request(:post, url, body: body, **) 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, **) request(:put, url, body: body, **) end |