class OneApm::Support::HTTPClients::HTTPClientRequest

Attributes

request[R]
uri[R]

Public Class Methods

new(request) click to toggle source
# File lib/one_apm/support/http_clients/httpclient_wrappers.rb, line 30
def initialize(request)
  @request = request
  @uri = request.header.request_uri
end

Public Instance Methods

[](key) click to toggle source
# File lib/one_apm/support/http_clients/httpclient_wrappers.rb, line 55
def [](key)
  request.headers[key]
end
[]=(key, value) click to toggle source
# File lib/one_apm/support/http_clients/httpclient_wrappers.rb, line 59
def []=(key, value)
  request.http_header[key] = value
end
body() click to toggle source
# File lib/one_apm/support/http_clients/httpclient_wrappers.rb, line 67
def body
  request.http_body.instance_values['body']
end
host() click to toggle source
# File lib/one_apm/support/http_clients/httpclient_wrappers.rb, line 43
def host
  if hostname = (self['host'] || self['Host'])
    hostname.split(':').first
  else
    uri.host.to_s
  end
end
method() click to toggle source
# File lib/one_apm/support/http_clients/httpclient_wrappers.rb, line 39
def method
  request.header.request_method
end
params() click to toggle source
# File lib/one_apm/support/http_clients/httpclient_wrappers.rb, line 75
def params
  post_params.merge(query)
end
port() click to toggle source
# File lib/one_apm/support/http_clients/httpclient_wrappers.rb, line 51
def port
  uri.port
end
post_params() click to toggle source
# File lib/one_apm/support/http_clients/httpclient_wrappers.rb, line 71
def post_params
  body.nil?? {} :  CGI.parse(body)
end
query() click to toggle source
# File lib/one_apm/support/http_clients/httpclient_wrappers.rb, line 63
def query
  @uri.query.nil?? {} : CGI.parse(@uri.query)
end
type() click to toggle source
# File lib/one_apm/support/http_clients/httpclient_wrappers.rb, line 35
def type
  "HTTPClient"
end