<commit_before>require 'faraday'

module BacklogApiClient
  class Client
    API_PATH = '/api/v2'

    def initialize(space_name, api_key)
      @api_key = api_key
      @http_cli = Faraday.new(url: "https://#{space_name}#{API_PATH}")
    end

    def get(resource_path)
      @http_cli.get("#{resource_path}?apiKey=#{@api_key}")
    end

    def post(resource_path, request = '')
      @http_cli.post "#{resource_path}?apiKey=#{@api_key}", request
    end

    def delete
    end

    def space
      BacklogApiClient::Client::Space.new(self)
    end

    def issues
      BacklogApiClient::Client::Issues.new(self)
    end
  end
end<commit_msg>[bugfix] set content-type header when send post method<commit_after>require 'faraday'

module BacklogApiClient
  class Client
    API_PATH = '/api/v2'

    def initialize(space_name, api_key)
      @api_key = api_key
      @http_cli = Faraday.new(url: "https://#{space_name}#{API_PATH}")
    end

    def get(resource_path)
      @http_cli.get "#{resource_path}?apiKey=#{@api_key}"
    end

    def post(resource_path, request = '')
      @http_cli.post do |req|
        req.url "#{resource_path}?apiKey=#{@api_key}"
        req.headers['Content-Type'] = 'application/json'
        req.body = request
      end
    end

    def delete
    end

    def space
      BacklogApiClient::Client::Space.new(self)
    end

    def issues
      BacklogApiClient::Client::Issues.new(self)
    end
  end
end
{'fraction_non_alphanumeric': 0.12552011095700416, 'fraction_numerical': 0.0013869625520110957, 'mean_word_length': 3.0083333333333333, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6937821', 'n_tokens_mistral': 507, 'n_tokens_neox': 492, 'n_words': 96}