我已经编写了用于创建多部分表单数据请求的 RUBY 代码。它在 ruby 1.9.3 中运行良好,但在 ruby 2.0 补丁 247 和补丁 0 中引发错误。
错误是,
/home/mohanrajr/Ruby/multipart/multipart_stream.rb:16:in `read': wrong number of arguments (2 for 1) (ArgumentError)
from /home/mohanrajr/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http/generic_request.rb:205:in `copy_stream'
from /home/mohanrajr/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http/generic_request.rb:205:in `send_request_with_body_stream'
from /home/mohanrajr/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http/generic_request.rb:132:in `exec'
from /home/mohanrajr/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:1404:in `block in transport_request'
from /home/mohanrajr/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:1403:in `catch'
from /home/mohanrajr/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:1403:in `transport_request'
from /home/mohanrajr/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:1376:in `request'
from /home/mohanrajr/Ruby/multipart/multipart.rb:38:in `block in post'
from /home/mohanrajr/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:852:in `start'
from /home/mohanrajr/Ruby/multipart/multipart.rb:38:in `post'
from multipart_post.rb:4:in `<main>'
感谢提前。