start

HTTP.start(address, port, p_addr, p_port, p_user, p_pass, &block)
HTTP.start(address, port=nil, p_addr=nil, p_port=nil, p_user=nil, p_pass=nil, opt, &block)
Class Public methods

Creates a new Net::HTTP object, then additionally opens the TCP connection and HTTP session.

Arguments are the following:

address

hostname or IP address of the server

port

port of the server

p_addr

address of proxy

p_port

port of proxy

p_user

user of proxy

p_pass

pass of proxy

opt

optional hash

opt sets following values by its accessor. The keys are #ca_file, #ca_path, cert, #cert_store, ciphers, #close_on_empty_response, key, #open_timeout, #read_timeout, #ssl_timeout, #ssl_version, use_ssl, #verify_callback, #verify_depth and verify_mode. If you set :use_ssl as true, you can use https and default value of #verify_mode is set as OpenSSL::SSL::VERIFY_PEER.

If the optional block is given, the newly created Net::HTTP object is passed to it and closed when the block finishes. In this case, the return value of this method is the return value of the block. If no block is given, the return value of this method is the newly created Net::HTTP object itself, and the caller is responsible for closing it upon completion using the finish() method.

doc_ruby_on_rails
2015-04-20 21:07:36
Comments
Leave a Comment

Please login to continue.