class OneApm::Support::HTTPClients::CurbRequest

Public Class Methods

new( curlobj ) click to toggle source
# File lib/one_apm/support/http_clients/curb_wrappers.rb, line 8
def initialize( curlobj )
  @curlobj = curlobj
end

Public Instance Methods

[]( key ) click to toggle source
# File lib/one_apm/support/http_clients/curb_wrappers.rb, line 28
def []( key )
  @curlobj.headers[ key ]
end
[]=( key, value ) click to toggle source
# File lib/one_apm/support/http_clients/curb_wrappers.rb, line 32
def []=( key, value )
  @curlobj.headers[ key ] = value
end
body() click to toggle source
# File lib/one_apm/support/http_clients/curb_wrappers.rb, line 44
def body
  @curlobj._oa_http_params
end
host() click to toggle source
# File lib/one_apm/support/http_clients/curb_wrappers.rb, line 16
def host
  self["host"] || self["Host"] || self.uri.host
end
method() click to toggle source
# File lib/one_apm/support/http_clients/curb_wrappers.rb, line 24
def method
  @curlobj._oa_http_verb
end
params() click to toggle source
# File lib/one_apm/support/http_clients/curb_wrappers.rb, line 52
def params
  post_params.merge(query)
end
port() click to toggle source
# File lib/one_apm/support/http_clients/curb_wrappers.rb, line 20
def port
  self["port"] || self["port"] || self.uri.port
end
post_params() click to toggle source
# File lib/one_apm/support/http_clients/curb_wrappers.rb, line 48
def post_params
  body.nil?? {} :  CGI.parse(body)
end
query() click to toggle source
# File lib/one_apm/support/http_clients/curb_wrappers.rb, line 40
def query
  @uri.query.nil?? {} : CGI.parse(@uri.query)
end
type() click to toggle source
# File lib/one_apm/support/http_clients/curb_wrappers.rb, line 12
def type
  'Curb'
end
uri() click to toggle source
# File lib/one_apm/support/http_clients/curb_wrappers.rb, line 36
def uri
  @uri ||= OneApm::Support::HTTPClients::URIUtil.parse_url(@curlobj.url)
end