summaryrefslogtreecommitdiff
path: root/lib/net
diff options
context:
space:
mode:
authoraycabta <aycabta@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-20 11:09:34 +0000
committeraycabta <aycabta@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-20 11:09:34 +0000
commit4ae20f046e29649abf1515c02acf2d8f8aef2e06 (patch)
tree53e6af006ca1d5bdda60b750bd172b6cb1a7a630 /lib/net
parent2bfbec874518d5efd5baf4381af7c47b78775c23 (diff)
Improve doc of multipart/form-data [Bug #15019]
* lib/net/http.rb: Documentation for Net::HTTP claims that multipart/form-data is not supported, but Net::HTTPHeader#set_form supports it since 1.9.3. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65230 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/net')
-rw-r--r--lib/net/http.rb7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/net/http.rb b/lib/net/http.rb
index 683a884f5d..69ec88a4e8 100644
--- a/lib/net/http.rb
+++ b/lib/net/http.rb
@@ -186,13 +186,10 @@ module Net #:nodoc:
# res.value
# end
#
- # At this time Net::HTTP does not support multipart/form-data. To send
- # multipart/form-data use Net::HTTPRequest#body= and
- # Net::HTTPRequest#content_type=:
+ # To send multipart/form-data use Net::HTTPHeader#set_form
#
# req = Net::HTTP::Post.new(uri)
- # req.body = multipart_data
- # req.content_type = 'multipart/form-data'
+ # req.set_form([['upload', File.open('foo.bar')]], 'multipart/form-data')
#
# Other requests that can contain a body such as PUT can be created in the
# same way using the corresponding request class (Net::HTTP::Put).