Ruby 2.0创建多部分表单数据

时间:2013-07-24 10:51:29

标签: multipartform-data ruby-2.0

我已经编写了用于创建多部分表单数据请求的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>'

感谢您提前。

0 个答案:

没有答案