Module: Datadog::Core::Transport::HTTP::Response

Overview

Wraps an HTTP response from an adapter.

Used by endpoints to wrap responses from adapters with fields or behavior that’s specific to that endpoint.

Instance Method Summary collapse

Instance Method Details

#client_error?Boolean

Returns:

  • (Boolean)


44
45
46
# File 'lib/datadog/core/transport/http/response.rb', line 44

def client_error?
  @http_response.client_error?
end

#codeObject



53
54
55
# File 'lib/datadog/core/transport/http/response.rb', line 53

def code
  @http_response.respond_to?(:code) ? @http_response.code : nil
end

#initialize(http_response) ⇒ Object



14
15
16
# File 'lib/datadog/core/transport/http/response.rb', line 14

def initialize(http_response)
  @http_response = http_response
end

#internal_error?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/datadog/core/transport/http/response.rb', line 24

def internal_error?
  @http_response.internal_error?
end

#not_found?Boolean

Returns:

  • (Boolean)


39
40
41
# File 'lib/datadog/core/transport/http/response.rb', line 39

def not_found?
  @http_response.not_found?
end

#ok?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/datadog/core/transport/http/response.rb', line 34

def ok?
  @http_response.ok?
end

#payloadObject



19
20
21
# File 'lib/datadog/core/transport/http/response.rb', line 19

def payload
  @http_response.payload
end

#server_error?Boolean

Returns:

  • (Boolean)


49
50
51
# File 'lib/datadog/core/transport/http/response.rb', line 49

def server_error?
  @http_response.server_error?
end

#unsupported?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/datadog/core/transport/http/response.rb', line 29

def unsupported?
  @http_response.unsupported?
end