Sha256: a62ed40bcf82ef08d93b00146cea9deea3bf7af39d95845a7cf54e9d3a4c5a49
Contents?: true
Size: 847 Bytes
Versions: 109
Compression:
Stored size: 847 Bytes
Contents
require 'net/http' require 'uri' module Gitlab module QA module Support class GetRequest attr_reader :uri, :token def initialize(uri, token) @uri = uri @token = token end def execute! response = Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http| http.request(build_request) end case response when Net::HTTPSuccess response else raise Support::InvalidResponseError.new(uri.to_s, response) end end private def build_request Net::HTTP::Get.new(uri).tap do |req| req['PRIVATE-TOKEN'] = token req['Cookie'] = ENV['QA_COOKIES'] if ENV['QA_COOKIES'] end end end end end end
Version data entries
109 entries across 109 versions & 1 rubygems