From 4ae20f046e29649abf1515c02acf2d8f8aef2e06 Mon Sep 17 00:00:00 2001 From: aycabta Date: Sat, 20 Oct 2018 11:09:34 +0000 Subject: 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 --- lib/net/http.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'lib/net') 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). -- cgit v1.2.3