Class: NewRelic::Agent::HTTPClients::HTTPClientRequest
Constant Summary
collapse
- HTTP_CLIENT =
'HTTPClient'.freeze
AbstractRequest::COLON, AbstractRequest::LHOST, AbstractRequest::UHOST
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
Returns a new instance of HTTPClientRequest.
30
31
32
|
# File 'lib/new_relic/agent/http_clients/httpclient_wrappers.rb', line 30
def initialize(request)
@request = request
end
|
Instance Attribute Details
#request ⇒ Object
Returns the value of attribute request.
26
27
28
|
# File 'lib/new_relic/agent/http_clients/httpclient_wrappers.rb', line 26
def request
@request
end
|
Instance Method Details
#[](key) ⇒ Object
56
57
58
|
# File 'lib/new_relic/agent/http_clients/httpclient_wrappers.rb', line 56
def [](key)
[key]
end
|
#[]=(key, value) ⇒ Object
60
61
62
|
# File 'lib/new_relic/agent/http_clients/httpclient_wrappers.rb', line 60
def []=(key, value)
request.[key] = value
end
|
64
65
66
|
# File 'lib/new_relic/agent/http_clients/httpclient_wrappers.rb', line 64
def
request.
end
|
#host ⇒ Object
48
49
50
|
# File 'lib/new_relic/agent/http_clients/httpclient_wrappers.rb', line 48
def host
|| uri.host.to_s
end
|
42
43
44
45
46
|
# File 'lib/new_relic/agent/http_clients/httpclient_wrappers.rb', line 42
def
if hostname = (self[LHOST] || self[UHOST])
hostname.split(COLON).first
end
end
|
#method ⇒ Object
38
39
40
|
# File 'lib/new_relic/agent/http_clients/httpclient_wrappers.rb', line 38
def method
request..request_method
end
|
#type ⇒ Object
34
35
36
|
# File 'lib/new_relic/agent/http_clients/httpclient_wrappers.rb', line 34
def type
HTTP_CLIENT
end
|
#uri ⇒ Object
52
53
54
|
# File 'lib/new_relic/agent/http_clients/httpclient_wrappers.rb', line 52
def uri
@uri ||= URIUtil.parse_and_normalize_url(request..request_uri)
end
|