get

in lib/gitlab_api.rb [16:30]


  def get(path)
    path = "#{ENDPOINT}/#{path}" unless path.start_with?(ENDPOINT)

    options = { headers: { 'Private-Token': token } }

    url = Addressable::URI.parse(path)
    existing_query_values = url.query_values || {}
    existing_query_values['per_page'] ||= 50
    url.query_values = existing_query_values

    HTTParty.get(url.to_s, options).tap do |response|
      check_response_code!(:get, url, response)
    end
  end