Class: NewRelic::Agent::HTTPClients::CurbRequest
- Inherits:
-
Object
- Object
- NewRelic::Agent::HTTPClients::CurbRequest
- Defined in:
- lib/new_relic/agent/http_clients/curb_wrappers.rb
Constant Summary collapse
- CURB =
'Curb'
- LHOST =
'host'
- UHOST =
'Host'
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, value) ⇒ Object
- #headers ⇒ Object
- #host ⇒ Object
- #host_from_header ⇒ Object
-
#initialize(curlobj) ⇒ CurbRequest
constructor
A new instance of CurbRequest.
- #method ⇒ Object
- #type ⇒ Object
- #uri ⇒ Object
Constructor Details
#initialize(curlobj) ⇒ CurbRequest
Returns a new instance of CurbRequest.
15 16 17 |
# File 'lib/new_relic/agent/http_clients/curb_wrappers.rb', line 15 def initialize(curlobj) @curlobj = curlobj end |
Instance Method Details
#[](key) ⇒ Object
35 36 37 |
# File 'lib/new_relic/agent/http_clients/curb_wrappers.rb', line 35 def [](key) headers[key] end |
#[]=(key, value) ⇒ Object
39 40 41 |
# File 'lib/new_relic/agent/http_clients/curb_wrappers.rb', line 39 def []=(key, value) headers[key] = value end |
#headers ⇒ Object
47 48 49 |
# File 'lib/new_relic/agent/http_clients/curb_wrappers.rb', line 47 def headers @curlobj.headers end |
#host ⇒ Object
27 28 29 |
# File 'lib/new_relic/agent/http_clients/curb_wrappers.rb', line 27 def host host_from_header || self.uri.host end |
#host_from_header ⇒ Object
23 24 25 |
# File 'lib/new_relic/agent/http_clients/curb_wrappers.rb', line 23 def host_from_header self[LHOST] || self[UHOST] end |
#method ⇒ Object
31 32 33 |
# File 'lib/new_relic/agent/http_clients/curb_wrappers.rb', line 31 def method @curlobj._nr_http_verb end |
#type ⇒ Object
19 20 21 |
# File 'lib/new_relic/agent/http_clients/curb_wrappers.rb', line 19 def type CURB end |
#uri ⇒ Object
43 44 45 |
# File 'lib/new_relic/agent/http_clients/curb_wrappers.rb', line 43 def uri @uri ||= URIUtil.parse_and_normalize_url(@curlobj.url) end |