From: alexandre.zanni@... Date: 2020-05-26T22:35:14+00:00 Subject: [ruby-core:98534] [Ruby master Misc#16916] [Documentation] Method: Net::HTTPHeader#set_form Issue #16916 has been reported by noraj (Alexandre ZANNI). ---------------------------------------- Misc #16916: [Documentation] Method: Net::HTTPHeader#set_form https://bugs.ruby-lang.org/issues/16916 * Author: noraj (Alexandre ZANNI) * Status: Open * Priority: Normal ---------------------------------------- Since this revision / commit - SVN Revision 65230 - https://bugs.ruby-lang.org/projects/ruby-master/repository/ruby_2_6/revisions/65230 - https://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/lib/net/http.rb?view=log&pathrev=65230 - https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=65230 - Git Revision 4ae20f04 - https://bugs.ruby-lang.org/projects/ruby-master/repository/git/revisions/4ae20f046e29649abf1515c02acf2d8f8aef2e06 - https://github.com/ruby/ruby/commit/4ae20f046e29649abf1515c02acf2d8f8aef2e06 - https://bugs.ruby-lang.org/projects/ruby-master/repository/git?utf8=%E2%9C%93&rev=4ae20f04 the [Net::HTTP](https://ruby-doc.org/stdlib-2.7.1/libdoc/net/http/rdoc/Net/HTTP.html#class-Net::HTTP-label-POST) documentation talks about multipart supports (as I understood introduced in ruby 1.9.3). When we go take a look at [Net::HTTPHeader#set_form](https://www.rubydoc.info/stdlib/net/Net%2FHTTPHeader:set_form), we read about a `formopt` argument and the following documentation > formopt is an optional hash to specify the detail. and the description of the structure of the params argument. The params argument is an array where each items contains 3 elements, the third one is `opt` described as > an optional hash to specify additional information But there is not documentation about what `formopt` and `opt` are expecting nor a reference to something else that can explain it. I think that `lib/net/http/header.rb` documentation for `Net::HTTPHeader#set_form` should be improved to include documentation about `formopt` and `opt`. https://github.com/ruby/ruby/blob/master/lib/net/http/header.rb#L453 https://bugs.ruby-lang.org/projects/ruby-master/repository/git/revisions/master/entry/lib/net/http/header.rb#L453 For example I guess that `opt` hash for an item of type file could maybe have an option to specify the content-type (eg. `application/zip`) or the name of the file, etc. -- https://bugs.ruby-lang.org/ Unsubscribe: