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' })
The default port to use for HTTP
requests; defaults to 80.
Returns the X.509 certificates the server presented.
The port of the proxy server, if one is configured.
The password of the proxy server, if one is configured.
utils
true if the response has a body.
Private setter for the path of the URI::FTP
.
Main name of the switch.