aboutsummaryrefslogtreecommitdiffstats
path: root/lib/net/http.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/net/http.rb')
-rw-r--r--lib/net/http.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/net/http.rb b/lib/net/http.rb
index 920301f350..0ae1ba8c8f 100644
--- a/lib/net/http.rb
+++ b/lib/net/http.rb
@@ -64,7 +64,7 @@ module Net #:nodoc:
# require 'uri'
#
# url = URI.parse('http://www.example.com/index.html')
- # res = Net::HTTP.start(url.host, url.port) {|http|
+ # res = Net::HTTP.start(url.hostname, url.port) {|http|
# http.get('/index.html')
# }
# puts res.body
@@ -75,7 +75,7 @@ module Net #:nodoc:
#
# url = URI.parse('http://www.example.com/index.html')
# req = Net::HTTP::Get.new(url.path)
- # res = Net::HTTP.start(url.host, url.port) {|http|
+ # res = Net::HTTP.start(url.hostname, url.port) {|http|
# http.request(req)
# }
# puts res.body
@@ -101,7 +101,7 @@ module Net #:nodoc:
# req = Net::HTTP::Post.new(url.path)
# req.basic_auth 'jack', 'pass'
# req.set_form_data({'from' => '2005-01-01', 'to' => '2005-03-31'}, ';')
- # res = Net::HTTP.new(url.host, url.port).start {|http| http.request(req) }
+ # res = Net::HTTP.new(url.hostname, url.port).start {|http| http.request(req) }
# case res
# when Net::HTTPSuccess, Net::HTTPRedirection
# # OK
@@ -390,7 +390,7 @@ module Net #:nodoc:
}
else
uri = uri_or_host
- new(uri.host, uri.port).start {|http|
+ new(uri.hostname, uri.port).start {|http|
return http.request_get(uri.request_uri, &block)
}
end
@@ -415,7 +415,7 @@ module Net #:nodoc:
req = Post.new(url.path)
req.form_data = params
req.basic_auth url.user, url.password if url.user
- new(url.host, url.port).start {|http|
+ new(url.hostname, url.port).start {|http|
http.request(req)
}
end