Class: HTTPI::Adapter::EmHttpRequest
- Defined in:
- lib/httpi/adapter/em_http.rb
Overview
An HTTPI adapter for EventMachine::HttpRequest. Due to limitations of
the em-httprequest library, not all features are supported. In particular,
- CA files,
- certificate verification modes other than "none" and "peer,"
- NTLM authentication,
- digest authentication, and
- password-protected certificate keys
are supported by HTTPI but not em-httprequest.
In addition, some features of em-httprequest are not represented in HTTPI and are therefore not supported. In particular,
- SOCKS5 proxying,
- automatic redirect following,
- response streaming,
- file body streaming,
- keepalive,
- pipelining, and
- multi-request
are supported by em-httprequest but not HTTPI.
Instance Attribute Summary collapse
- #cert_directory ⇒ Object
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
-
#initialize(request) ⇒ EmHttpRequest
constructor
A new instance of EmHttpRequest.
-
#request(method) ⇒ Object
Executes arbitrary HTTP requests.
Methods inherited from Base
Constructor Details
#initialize(request) ⇒ EmHttpRequest
Returns a new instance of EmHttpRequest.
34 35 36 37 |
# File 'lib/httpi/adapter/em_http.rb', line 34 def initialize(request) @request = request @client = EventMachine::HttpRequest.new build_request_url(request.url), end |
Instance Attribute Details
#cert_directory ⇒ Object
41 42 43 |
# File 'lib/httpi/adapter/em_http.rb', line 41 def cert_directory @cert_directory ||= "/tmp" end |
#client ⇒ Object (readonly)
Returns the value of attribute client.
39 40 41 |
# File 'lib/httpi/adapter/em_http.rb', line 39 def client @client end |
Instance Method Details
#request(method) ⇒ Object
Executes arbitrary HTTP requests.
49 50 51 |
# File 'lib/httpi/adapter/em_http.rb', line 49 def request(method) _request { || @client.send method, } end |