Class: Datadog::CI::Transport::Api::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/datadog/ci/transport/api/base.rb

Direct Known Subclasses

Agentless, EvpProxy

Instance Method Summary collapse

Instance Method Details

#api_request(path:, payload:, headers: {}, verb: "post") ⇒ Object



10
11
12
# File 'lib/datadog/ci/transport/api/base.rb', line 10

def api_request(path:, payload:, headers: {}, verb: "post")
  headers[Ext::Transport::HEADER_CONTENT_TYPE] ||= Ext::Transport::CONTENT_TYPE_JSON
end

#citestcycle_request(path:, payload:, headers: {}, verb: "post") ⇒ Object



14
15
16
# File 'lib/datadog/ci/transport/api/base.rb', line 14

def citestcycle_request(path:, payload:, headers: {}, verb: "post")
  headers[Ext::Transport::HEADER_CONTENT_TYPE] ||= Ext::Transport::CONTENT_TYPE_MESSAGEPACK
end

#headers_with_default(headers) ⇒ Object



18
19
20
21
# File 'lib/datadog/ci/transport/api/base.rb', line 18

def headers_with_default(headers)
  request_headers = default_headers
  request_headers.merge!(headers)
end