Class: NewRelic::Agent::HTTPClients::TyphoeusHTTPRequest
Constant Summary
collapse
- TYPHOEUS =
'Typhoeus'.freeze
- GET =
'GET'.freeze
AbstractRequest::COLON, AbstractRequest::LHOST, AbstractRequest::UHOST
Instance Method Summary
collapse
Constructor Details
Returns a new instance of TyphoeusHTTPRequest.
[View source]
37
38
39
40
41
42
43
|
# File 'lib/new_relic/agent/http_clients/typhoeus_wrappers.rb', line 37
def initialize(request)
@request = request
@uri = case request.url
when ::URI then request.url
else NewRelic::Agent::HTTPClients::URIUtil.parse_and_normalize_url(request.url)
end
end
|
Instance Method Details
[View source]
65
66
67
68
69
|
# File 'lib/new_relic/agent/http_clients/typhoeus_wrappers.rb', line 65
def [](key)
return nil unless @request.options &&
[key]
end
|
permalink
#[]=(key, value) ⇒ Object
[View source]
71
72
73
|
# File 'lib/new_relic/agent/http_clients/typhoeus_wrappers.rb', line 71
def []=(key, value)
[key] = value
end
|
[View source]
75
76
77
|
# File 'lib/new_relic/agent/http_clients/typhoeus_wrappers.rb', line 75
def
@request.options[:headers] || {}
end
|
[View source]
55
56
57
|
# File 'lib/new_relic/agent/http_clients/typhoeus_wrappers.rb', line 55
def host
|| @uri.host
end
|
[View source]
51
52
53
|
# File 'lib/new_relic/agent/http_clients/typhoeus_wrappers.rb', line 51
def
self[LHOST] || self[UHOST]
end
|
[View source]
61
62
63
|
# File 'lib/new_relic/agent/http_clients/typhoeus_wrappers.rb', line 61
def method
(@request.options[:method] || GET).to_s.upcase
end
|
[View source]
47
48
49
|
# File 'lib/new_relic/agent/http_clients/typhoeus_wrappers.rb', line 47
def type
TYPHOEUS
end
|
[View source]
79
80
81
|
# File 'lib/new_relic/agent/http_clients/typhoeus_wrappers.rb', line 79
def uri
@uri
end
|