Sha256: f8b4ef89661f1298d9e55e4a4299f9f6cf3c147fec2f6685ef637027994207a4
Contents?: true
Size: 530 Bytes
Versions: 21
Compression:
Stored size: 530 Bytes
Contents
# encoding: utf-8 require "uri" module RequestHelpers PORT = 5678 def get path, options = {} accept = options.delete(:accept) { :json } url = URI("http://localhost:#{PORT}").merge(path) HTTP.accept(accept).basic_auth(user: "admin", pass: "admin") .get(url, options) end def post path, options = {} accept = options.delete(:accept) { :json } url = URI("http://localhost:#{PORT}").merge(path) HTTP.accept(accept).basic_auth(user: "admin", pass: "admin") .post(url, options) end end
Version data entries
21 entries across 21 versions & 1 rubygems