Class: RubyProxyHeaders::HTTPGem::ProxyClient
- Inherits:
-
Object
- Object
- RubyProxyHeaders::HTTPGem::ProxyClient
- 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
-
#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.
45 46 47 48 49 |
# File 'lib/ruby_proxy_headers/http_gem.rb', line 45 def initialize(proxy:, proxy_headers: {}, **) @proxy = proxy @proxy_headers = proxy_headers @default_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, **) request(:delete, url, **) end |
#get(url, **options) ⇒ Object
51 52 53 |
# File 'lib/ruby_proxy_headers/http_gem.rb', line 51 def get(url, **) request(:get, url, **) 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, **) request(:post, url, body: body, **) 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, **) request(:put, url, body: body, **) end |