Sha256: 53c600852c89ed22d21e06d5cc89e7343f58e4683a1a8eedc1f55416b66d1683
Contents?: true
Size: 710 Bytes
Versions: 16
Compression:
Stored size: 710 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.respond_to?(:env) ? config.env : config[:environment], :hostname => config[:hostname], :gem_version => Appsignal::VERSION }, :headers => { "Content-Type" => "application/json; charset=UTF-8" } } body = Appsignal::Utils::JSON.generate(body) if body.is_a? Hash options[:body] = body if body endpoint = config[:endpoint] || Appsignal::Config::DEFAULT_CONFIG[:endpoint] stub_request(:post, "#{endpoint}/1/#{path}").with(options) end end
Version data entries
16 entries across 16 versions & 1 rubygems