Sha256: 572d37905bf36ae267fab25eb80a259de19f64d4f1ac8955038a966e21afe215

Contents?: true

Size: 696 Bytes

Versions: 7

Compression:

Stored size: 696 Bytes

Contents

# frozen_string_literal: true

require_relative "../../ext/transport"

module Datadog
  module CI
    module Transport
      module Api
        class Base
          attr_reader :http

          def initialize(http:)
            @http = http
          end

          def request(path:, payload:, verb: "post")
            http.request(
              path: path,
              payload: payload,
              verb: verb,
              headers: headers
            )
          end

          private

          def headers
            {
              Ext::Transport::HEADER_CONTENT_TYPE => Ext::Transport::CONTENT_TYPE_MESSAGEPACK
            }
          end
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
datadog-ci-0.7.0 lib/datadog/ci/transport/api/base.rb
datadog-ci-0.6.0 lib/datadog/ci/transport/api/base.rb
datadog-ci-0.5.1 lib/datadog/ci/transport/api/base.rb
datadog-ci-0.5.0 lib/datadog/ci/transport/api/base.rb
datadog-ci-0.4.1 lib/datadog/ci/transport/api/base.rb
datadog-ci-0.4.0 lib/datadog/ci/transport/api/base.rb
datadog-ci-0.3.0 lib/datadog/ci/transport/api/base.rb