newobj

newobj(address, port = nil, p_addr = :ENV, p_port = nil, p_user = nil, p_pass = nil) Class Public methods Alias for: new

new 2

new(address, port = nil) Class Public methods Creates a new Net::HTTP object for the specified server address, without opening the TCP connection or initializing the HTTP session. The address should be a DNS hostname or IP address.

new

new(address, port = nil, p_addr = :ENV, p_port = nil, p_user = nil, p_pass = nil) Class Public methods Creates a new Net::HTTP object without opening a TCP connection or HTTP session. The address should be a DNS hostname or IP address, the port is the port the server operates on. If no port is given the default port for HTTP or HTTPS is used. If none of the p_ arguments are given, the proxy host and port are taken from the http_proxy environment variable (or its uppercase equivale

is_version_1_2?

is_version_1_2?() Class Public methods Alias for: version_1_2?

https_default_port

https_default_port() Class Public methods The default port to use for HTTPS requests; defaults to 443.

http_default_port

http_default_port() Class Public methods The default port to use for HTTP requests; defaults to 80.

get_response

get_response(uri_or_host, path = nil, port = nil, &block) Class Public methods 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

get_print

get_print(uri_or_host, path = nil, port = nil) Class Public methods Gets the body text from the target and outputs it to $stdout. The target can either be specified as (uri), or as (host, path, port = 80); so: Net::HTTP.get_print URI('http://www.example.com/index.html') or: Net::HTTP.get_print 'www.example.com', '/index.html'

get

get(uri_or_host, path = nil, port = nil) Class Public methods Sends a GET request to the target and returns the HTTP response as a string. The target can either be specified as (uri), or as (host, path, port = 80); so: print Net::HTTP.get(URI('http://www.example.com/index.html')) or: print Net::HTTP.get('www.example.com', '/index.html')

default_port

default_port() Class Public methods The default port to use for HTTP requests; defaults to 80.