class NewRelic::Agent::HTTPClients::TyphoeusHTTPRequest
Public Class Methods
new(request)
click to toggle source
# File lib/new_relic/agent/http_clients/typhoeus_wrappers.rb, line 38 def initialize(request) @request = request @uri = case request.url when ::URI then request.url else NewRelic::Agent::HTTPClients::URIUtil.parse_url(request.url) end end
Public Instance Methods
[](key)
click to toggle source
# File lib/new_relic/agent/http_clients/typhoeus_wrappers.rb, line 58 def [](key) return nil unless @request.options && @request.options[:headers] @request.options[:headers][key] end
[]=(key, value)
click to toggle source
# File lib/new_relic/agent/http_clients/typhoeus_wrappers.rb, line 63 def []=(key, value) @request.options[:headers] ||= {} @request.options[:headers][key] = value end
host()
click to toggle source
# File lib/new_relic/agent/http_clients/typhoeus_wrappers.rb, line 50 def host self['host'] || self['Host'] || @uri.host end
method()
click to toggle source
# File lib/new_relic/agent/http_clients/typhoeus_wrappers.rb, line 54 def method (@request.options[:method] || 'GET').to_s.upcase end
type()
click to toggle source
# File lib/new_relic/agent/http_clients/typhoeus_wrappers.rb, line 46 def type "Typhoeus" end
uri()
click to toggle source
# File lib/new_relic/agent/http_clients/typhoeus_wrappers.rb, line 68 def uri @uri end