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
), 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
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.
The default port for IMAP
connections, port 143
Similar to search()
, but returns unique identifiers.
Similar to sort()
, but returns an array of unique identifiers.
Leaves IDLE.
returns the port for POP3
Opens a POP3
session, attempts authentication, and quits.
This method raises POPAuthenticationError
if authentication fails.
POP3
Net::POP3.auth_only('pop.example.com', 110, 'YourAccount', 'YourPassword')
APOP
Net::POP3.auth_only('pop.example.com', 110, 'YourAccount', 'YourPassword', true)
Starts a pop3 session, attempts authentication, and quits. This method must not be called while POP3
session is opened. This method raises POPAuthenticationError
if authentication fails.