Sha256: 5cc7784dec314447337353b7246ba1fcd377aafe6d85ee81b4500be9034904e6
Contents?: true
Size: 674 Bytes
Versions: 13
Compression:
Stored size: 674 Bytes
Contents
module ApiRequestHelper def stub_api_request(config, path, body = nil) options = { :query => { :api_key => config[:push_api_key], :name => config[:name], :environment => config.env, :hostname => config[:hostname], :gem_version => Appsignal::VERSION }, :headers => { 'Content-Encoding' => 'gzip', 'Content-Type' => 'application/json; charset=UTF-8', } } if body.is_a? Hash body = Appsignal::Utils::Gzip.compress(Appsignal::Utils::JSON.generate(body)) end options[:body] = body if body stub_request(:post, "#{config[:endpoint]}/1/#{path}").with(options) end end
Version data entries
13 entries across 13 versions & 1 rubygems