Class: NewRelic::Agent::HTTPClients::CurbRequest

Inherits:
AbstractRequest show all
Defined in:
lib/new_relic/agent/http_clients/curb_wrappers.rb

Constant Summary collapse

CURB =
'Curb'

Constants inherited from AbstractRequest

AbstractRequest::COLON, AbstractRequest::LHOST, AbstractRequest::UHOST

Instance Method Summary collapse

Constructor Details

#initialize(curlobj) ⇒ CurbRequest

Returns a new instance of CurbRequest.



13
14
15
# File 'lib/new_relic/agent/http_clients/curb_wrappers.rb', line 13

def initialize(curlobj)
  @curlobj = curlobj
end

Instance Method Details

#[](key) ⇒ Object



33
34
35
# File 'lib/new_relic/agent/http_clients/curb_wrappers.rb', line 33

def [](key)
  headers[key]
end

#[]=(key, value) ⇒ Object



37
38
39
# File 'lib/new_relic/agent/http_clients/curb_wrappers.rb', line 37

def []=(key, value)
  headers[key] = value
end

#headersObject



45
46
47
# File 'lib/new_relic/agent/http_clients/curb_wrappers.rb', line 45

def headers
  @curlobj.headers
end

#hostObject



25
26
27
# File 'lib/new_relic/agent/http_clients/curb_wrappers.rb', line 25

def host
  host_from_header || self.uri.host
end

#host_from_headerObject



21
22
23
# File 'lib/new_relic/agent/http_clients/curb_wrappers.rb', line 21

def host_from_header
  self[LHOST] || self[UHOST]
end

#methodObject



29
30
31
# File 'lib/new_relic/agent/http_clients/curb_wrappers.rb', line 29

def method
  @curlobj._nr_http_verb
end

#typeObject



17
18
19
# File 'lib/new_relic/agent/http_clients/curb_wrappers.rb', line 17

def type
  CURB
end

#uriObject



41
42
43
# File 'lib/new_relic/agent/http_clients/curb_wrappers.rb', line 41

def uri
  @uri ||= URIUtil.parse_and_normalize_url(@curlobj.url)
end