Module: RubyProxyHeaders::HTTPGem
- Defined in:
- lib/ruby_proxy_headers/http_gem.rb
Overview
HTTP.rb (http gem) integration for proxy headers support.
Defined Under Namespace
Classes: ProxyClient
Class Method Summary collapse
-
.create_client(proxy:, proxy_headers: {}, **options) ⇒ ProxyClient
Create an HTTP client with proxy header support.
-
.get(url, proxy:, proxy_headers: {}, **options) ⇒ Object
Make a GET request with proxy headers.
-
.post(url, proxy:, proxy_headers: {}, body: nil, **options) ⇒ Object
Make a POST request with proxy headers.
Class Method Details
.create_client(proxy:, proxy_headers: {}, **options) ⇒ ProxyClient
Create an HTTP client with proxy header support.
21 22 23 |
# File 'lib/ruby_proxy_headers/http_gem.rb', line 21 def self.create_client(proxy:, proxy_headers: {}, **) ProxyClient.new(proxy: proxy, proxy_headers: proxy_headers, **) end |
.get(url, proxy:, proxy_headers: {}, **options) ⇒ Object
Make a GET request with proxy headers.
26 27 28 |
# File 'lib/ruby_proxy_headers/http_gem.rb', line 26 def self.get(url, proxy:, proxy_headers: {}, **) create_client(proxy: proxy, proxy_headers: proxy_headers).get(url, **) end |
.post(url, proxy:, proxy_headers: {}, body: nil, **options) ⇒ Object
Make a POST request with proxy headers.
31 32 33 |
# File 'lib/ruby_proxy_headers/http_gem.rb', line 31 def self.post(url, proxy:, proxy_headers: {}, body: nil, **) create_client(proxy: proxy, proxy_headers: proxy_headers).post(url, body: body, **) end |