Class: NewRelic::Agent::HTTPClients::HTTPRequest
Constant Summary
collapse
- HTTP_RB =
'http.rb'
AbstractRequest::COLON, AbstractRequest::LHOST, AbstractRequest::UHOST
Instance Method Summary
collapse
Constructor Details
#initialize(wrapped_request) ⇒ HTTPRequest
Returns a new instance of HTTPRequest.
24
25
26
|
# File 'lib/new_relic/agent/http_clients/http_rb_wrappers.rb', line 24
def initialize(wrapped_request)
@wrapped_request = wrapped_request
end
|
Instance Method Details
#[](key) ⇒ Object
50
51
52
|
# File 'lib/new_relic/agent/http_clients/http_rb_wrappers.rb', line 50
def [](key)
@wrapped_request.[key]
end
|
#[]=(key, value) ⇒ Object
54
55
56
|
# File 'lib/new_relic/agent/http_clients/http_rb_wrappers.rb', line 54
def []=(key, value)
@wrapped_request.[key] = value
end
|
58
59
60
|
# File 'lib/new_relic/agent/http_clients/http_rb_wrappers.rb', line 58
def
@wrapped_request..to_hash
end
|
#host ⇒ Object
42
43
44
|
# File 'lib/new_relic/agent/http_clients/http_rb_wrappers.rb', line 42
def host
|| @wrapped_request.host
end
|
36
37
38
39
40
|
# File 'lib/new_relic/agent/http_clients/http_rb_wrappers.rb', line 36
def
if hostname = self[LHOST]
hostname.split(COLON).first
end
end
|
#method ⇒ Object
46
47
48
|
# File 'lib/new_relic/agent/http_clients/http_rb_wrappers.rb', line 46
def method
@wrapped_request.verb.upcase
end
|
#type ⇒ Object
32
33
34
|
# File 'lib/new_relic/agent/http_clients/http_rb_wrappers.rb', line 32
def type
HTTP_RB
end
|
#uri ⇒ Object
28
29
30
|
# File 'lib/new_relic/agent/http_clients/http_rb_wrappers.rb', line 28
def uri
@uri ||= URIUtil.parse_and_normalize_url(@wrapped_request.uri)
end
|