Method: Net::HTTP#initialize
- Defined in:
- lib/extensions/net-http/net/http.rb
#initialize(address, port = nil) ⇒ HTTP
Creates a new Net::HTTP object for the specified address. This method does not open the TCP connection.
522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 |
# File 'lib/extensions/net-http/net/http.rb', line 522 def initialize(address, port = nil) @address = address @port = (port || HTTP.default_port) @curr_http_version = HTTPVersion @no_keepalive_server = false @close_on_empty_response = false @socket = nil @started = false @open_timeout = nil @read_timeout = 60 @debug_output = nil @use_ssl = false @ssl_context = nil @enable_post_connection_check = true @compression = nil @sspi_enabled = false if defined?(SSL_ATTRIBUTES) SSL_ATTRIBUTES.each do |name| instance_variable_set "@#{name}", nil end end end |