class NewRelic::Agent::HTTPClients::HTTPClientRequest

Constants

HTTP_CLIENT

Attributes

request[R]

Public Class Methods

new(request) click to toggle source
# File lib/new_relic/agent/http_clients/httpclient_wrappers.rb, line 30
def initialize(request)
  @request = request
end

Public Instance Methods

[](key) click to toggle source
# File lib/new_relic/agent/http_clients/httpclient_wrappers.rb, line 56
def [](key)
  headers[key]
end
[]=(key, value) click to toggle source
# File lib/new_relic/agent/http_clients/httpclient_wrappers.rb, line 60
def []=(key, value)
  request.http_header[key] = value
end
headers() click to toggle source
# File lib/new_relic/agent/http_clients/httpclient_wrappers.rb, line 64
def headers
  request.headers
end
host() click to toggle source
# File lib/new_relic/agent/http_clients/httpclient_wrappers.rb, line 48
def host
  host_from_header || uri.host.to_s
end
host_from_header() click to toggle source
# File lib/new_relic/agent/http_clients/httpclient_wrappers.rb, line 42
def host_from_header
  if hostname = (self[LHOST] || self[UHOST])
    hostname.split(COLON).first
  end
end
method() click to toggle source
# File lib/new_relic/agent/http_clients/httpclient_wrappers.rb, line 38
def method
  request.header.request_method
end
type() click to toggle source
# File lib/new_relic/agent/http_clients/httpclient_wrappers.rb, line 34
def type
  HTTP_CLIENT
end
uri() click to toggle source
# File lib/new_relic/agent/http_clients/httpclient_wrappers.rb, line 52
def uri
  @uri ||= URIUtil.parse_and_normalize_url(request.header.request_uri)
end