Class: Selenium::WebDriver::Remote::Http::Curb
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
Common
|
|
Instance Chain:
self,
Common
|
|
Inherits: |
Selenium::WebDriver::Remote::Http::Common
|
Defined in: | rb/lib/selenium/webdriver/remote/http/curb.rb |
Overview
An alternative to the default Net::HTTP
client.
This can be used for the ::Selenium::WebDriver::Firefox
and ::Selenium::WebDriver::Remote
drivers if you have Curb
installed.
Constant Summary
Common
- Inherited
Class Attribute Summary
Common
- Inherited
Class Method Summary
- .new(timeout: nil) ⇒ Curb constructor
Instance Attribute Summary
Instance Method Summary
- #quit_errors
- #client private
- #request(verb, url, headers, payload) private
Common
- Inherited
#call | steep:ignore:start. |
#close, #quit_errors, #common_headers, #create_response, #request |
Constructor Details
.new(timeout: nil) ⇒ Curb
# File 'rb/lib/selenium/webdriver/remote/http/curb.rb', line 42
def initialize(timeout: nil) @timeout = timeout super() end
Instance Attribute Details
#timeout (rw)
[ GitHub ]# File 'rb/lib/selenium/webdriver/remote/http/curb.rb', line 40
attr_accessor :timeout
Instance Method Details
#client (private)
[ GitHub ]#quit_errors
[ GitHub ]# File 'rb/lib/selenium/webdriver/remote/http/curb.rb', line 47
def quit_errors [Curl::Err::RecvError] + super end
#request(verb, url, headers, payload) (private)
[ GitHub ]# File 'rb/lib/selenium/webdriver/remote/http/curb.rb', line 53
def request(verb, url, headers, payload) client.url = url.to_s # workaround for http://github.com/taf2/curb/issues/issue/40 # curb will handle this for us anyway headers.delete 'Content-Length' client.headers = headers # http://github.com/taf2/curb/issues/issue/33 client.head = false client.delete = false case verb when :get client.http_get when :post client.post_body = payload || '' client.http_post when :put client.put_data = payload || '' client.http_put when :delete client.http_delete when :head client.http_head else raise Error::WebDriverError, "unknown HTTP verb: #{verb.inspect}" end create_response client.response_code, client.body_str, client.content_type end