class NewRelic::Agent::HTTPClients::TyphoeusHTTPRequest

Constants

GET
TYPHOEUS

Public Class Methods

new(request) click to toggle source
# 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

Public Instance Methods

[](key) click to toggle source
# File lib/new_relic/agent/http_clients/typhoeus_wrappers.rb, line 65
def [](key)
  return nil unless @request.options && headers

  headers[key]
end
[]=(key, value) click to toggle source
# File lib/new_relic/agent/http_clients/typhoeus_wrappers.rb, line 71
def []=(key, value)
  headers[key] = value
end
headers() click to toggle source
# File lib/new_relic/agent/http_clients/typhoeus_wrappers.rb, line 75
def headers
  @request.options[:headers] || {}
end
host() click to toggle source
# File lib/new_relic/agent/http_clients/typhoeus_wrappers.rb, line 55
def host
  host_from_header || @uri.host
end
host_from_header() click to toggle source
# File lib/new_relic/agent/http_clients/typhoeus_wrappers.rb, line 51
def host_from_header
  self[LHOST] || self[UHOST]
end
method() click to toggle source
# File lib/new_relic/agent/http_clients/typhoeus_wrappers.rb, line 61
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 47
def type
  TYPHOEUS
end
uri() click to toggle source
# File lib/new_relic/agent/http_clients/typhoeus_wrappers.rb, line 79
def uri
  @uri
end