We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 63398f3 commit 0674aefCopy full SHA for 0674aef
lib/net/http.rb
@@ -902,7 +902,7 @@ def HTTP.post_form(url, params)
902
903
# Sends a PUT request to the server; returns a Net::HTTPResponse object.
904
#
905
- # Argument +url+ must be a URL;
+ # Argument +url+ must be a URL object or a URI string;
906
# argument +data+ must be a string:
907
908
# _uri = uri.dup
@@ -927,6 +927,7 @@ def HTTP.post_form(url, params)
927
# - Net::HTTP#put: convenience method for \HTTP method +PUT+.
928
929
def HTTP.put(url, data, header = nil)
930
+ url = URI(url) if url.is_a?(String)
931
start(url.hostname, url.port,
932
:use_ssl => url.scheme == 'https' ) {|http|
933
http.put(url, data, header)
0 commit comments