Welcome to mirror list, hosted at ThFree Co, Russian Federation.

http_adapter.rb « fogbugz_import « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: bfae7a10f5b8b6ef2572c5c596b127568288e76b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# frozen_string_literal: true

module Gitlab
  module FogbugzImport
    class HttpAdapter
      def initialize(options = {})
        @root_url = options[:uri]
      end

      def request(action, options = {})
        uri = Gitlab::Utils.append_path(@root_url, 'api.asp')

        params = { 'cmd' => action }.merge(options.fetch(:params, {}))

        response = Gitlab::HTTP.post(uri, body: params)

        response.body
      end
    end
  end
end