Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

14 lines (10 sloc) 0.312 kb
# All the APIs in Net::HTTP are synchronous.
# We have to use threads.
require "net/http"
require "uri"
Thread.new do
# Do normal Net::HTTP stuff here.
uri = URI.parse("http://google.com/")
http = Net::HTTP.new(uri.host, uri.port)
response = http.request(Net::HTTP::Get.new(uri.request_uri))
end.join
Jump to Line
Something went wrong with that request. Please try again.