aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-04-22 02:27:10 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-04-22 02:27:10 +0000
commit44dc0f32d38abf2d99734b0ca91a85af109c4324 (patch)
tree2a2faa640e8038f3a845d472caf796cecdf09a71 /lib
parent8a77a41fc35579ccc23eb743ab2bd1f3f854d89e (diff)
downloadruby-44dc0f32d38abf2d99734b0ca91a85af109c4324.tar.gz
* lib/net/http.rb: Improve documentation for SSL requests via GET method.
[fix GH-1325][ci skip] Patch by @jsyeo git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54670 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/net/http.rb13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/net/http.rb b/lib/net/http.rb
index f6499f2a59..873d731a3a 100644
--- a/lib/net/http.rb
+++ b/lib/net/http.rb
@@ -260,15 +260,20 @@ module Net #:nodoc:
#
# uri = URI('https://secure.example.com/some_path?query=string')
#
- # Net::HTTP.start(uri.host, uri.port,
- # :use_ssl => uri.scheme == 'https') do |http|
+ # Net::HTTP.start(uri.host, uri.port, :use_ssl => true) do |http|
# request = Net::HTTP::Get.new uri
- #
# response = http.request request # Net::HTTPResponse object
# end
#
+ # Or if you simply want to make a GET request, you may pass in an URI
+ # object that has a HTTPS URL. Net::HTTP automatically turn on TLS
+ # verification if the URI object has a 'https' URI scheme.
+ #
+ # uri = URI('https://example.com/')
+ # Net::HTTP.get(uri) # => String
+ #
# In previous versions of Ruby you would need to require 'net/https' to use
- # HTTPS. This is no longer true.
+ # HTTPS. This is no longer true.
#
# === Proxies
#