Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
require 'net/http'
require 'uri'
require 'forwardable'
class Request
extend Forwardable
def_delegators :@uri, :request_uri, :hostname, :port
def initialize(url)
@uri = URI(url)
end
def get
req = Net::HTTP::Get.new(request_uri)
req['Accept'] = 'application/xml'
Net::HTTP.start(hostname, port) {|http| http.request(req) }.body
end
end