Sha256: cedf2e927c69333d31941bdb54424534f8a37e6d6474904fc3dec52e84cd8dc1
Contents?: true
Size: 528 Bytes
Versions: 16
Compression:
Stored size: 528 Bytes
Contents
require 'net/http' require 'uri' class Zapi attr_reader :uri, :response, :responder def initialize zapi_url: ENV['ZAPI_URI'], responder: nil @uri = URI.parse(zapi_url) @responder = responder || ZapiResponse end def request xml: http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE req = Net::HTTP::Post.new(uri.request_uri) req.body = xml @response = responder.new(raw_response: http.request(req)) @response.data end end
Version data entries
16 entries across 16 versions & 1 rubygems