Sha256: 8c5730827e21ea0c4a07259e030b83507693b15e72f4a599f455597afd66a50e
Contents?: true
Size: 420 Bytes
Versions: 13
Compression:
Stored size: 420 Bytes
Contents
class String def fetch(headers = {}) headers['User-Agent'] = 'GemVein Museum' require 'net/http' require 'net/https' uri = URI.parse(self) http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = (uri.scheme == "https") http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Get.new(uri.request_uri, headers) response = http.request(request) response.body end end
Version data entries
13 entries across 13 versions & 1 rubygems