Sha256: fa2f58f5dd591089a7aa5746a6fc282d9be1a72fca6a422b4a088e7d6c89f5a5
Contents?: true
Size: 531 Bytes
Versions: 56
Compression:
Stored size: 531 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
56 entries across 56 versions & 1 rubygems