Same as IO
.
Calls superclass method.
Routes respond_to? to the referenced remote object.
Routes respond_to? to the referenced remote object.
Sends a GET request to the target and returns the HTTP
response as a Net::HTTPResponse
object. The target can either be specified as (uri
, headers
), or as (host
, path
, port
= 80); so:
res = Net::HTTP.get_response(URI('http://www.example.com/index.html')) print res.body
or:
res = Net::HTTP.get_response('www.example.com', '/index.html') print res.body
you can also specify request headers:
Net::HTTP.get_response(URI('http://www.example.com/index.html'), { 'Accept' => 'text/html' })
Setter for the read_timeout
attribute.
Setter for the write_timeout
attribute.
Executes a request which uses a representation and returns its body.