You can refer to examples for Net::HTTP
. You need to pass a string in Net::HTTP::Get.new
Here is an example from it (note uri.request_uri
):
uri = URI('http://example.com/some_path?query=string')
Net::HTTP.start(uri.host, uri.port) do |http|
request = Net::HTTP::Get.new uri.request_uri
response = http.request request # Net::HTTPResponse object
end
GET parameters you can append to the URL. Just pay attention to the URL encoding. See for example this SO question.