class NewRelic::Agent::HTTPClients::AsyncHTTPRequest
Constants
- ASYNC_HTTP
Public Class Methods
Source
# File lib/new_relic/agent/http_clients/async_http_wrappers.rb, line 26 def initialize(connection, method, url, headers) @connection = connection @method = method @url = ::NewRelic::Agent::HTTPClients::URIUtil.parse_and_normalize_url(url) @headers = headers end
Public Instance Methods
Source
# File lib/new_relic/agent/http_clients/async_http_wrappers.rb, line 49 def [](key) return headers[key] unless headers.is_a?(Array) headers.each do |header| return header[1] if header[0].casecmp?(key) end nil end
Source
# File lib/new_relic/agent/http_clients/async_http_wrappers.rb, line 58 def []=(key, value) if headers.is_a?(Array) headers << [key, value] else headers[key] = value end end
Source
# File lib/new_relic/agent/http_clients/async_http_wrappers.rb, line 70 def headers @headers end
Source
# File lib/new_relic/agent/http_clients/async_http_wrappers.rb, line 45 def host host_from_header || uri.host.to_s end
Source
# File lib/new_relic/agent/http_clients/async_http_wrappers.rb, line 39 def host_from_header if hostname = (self[LHOST] || self[UHOST]) hostname.split(COLON).first end end
Source
# File lib/new_relic/agent/http_clients/async_http_wrappers.rb, line 74 def method @method end
Source
# File lib/new_relic/agent/http_clients/async_http_wrappers.rb, line 35 def type ASYNC_HTTP end
Source
# File lib/new_relic/agent/http_clients/async_http_wrappers.rb, line 66 def uri @url end