我正在尝试使用法拉第发送GET请求
@resp = begin
connection.get(path, data)
rescue Exception => e
[]
end
如果我删除救援部分,我会
17:39:54 web.1 | Completed 500 Internal Server Error in 49ms 17:39:54 web.1 | NoMethodError - undefined method `each' for
#<String:0x007fe46c815d50>: 17:39:54 web.1 | () Users/password123/.rvm/gems/ruby-1.9.3-p484/bundler/gems/faraday-f4e3fc344072/lib/faraday/utils.rb:120:in `update' 17:39:54 web.1 | () Users/password123/.rvm/gems/ruby-1.9.3-p484/bundler/gems/faraday-f4e3fc344072/lib/faraday/connection.rb:134:in `block in get' 17:39:54 web.1 | () Users/password123/.rvm/gems/ruby-1.9.3-p484/bundler/gems/faraday-f4e3fc344072/lib/faraday/connection.rb:344:in `block in run_request' 17:39:54 web.1 | () Users/password123/.rvm/gems/ruby-1.9.3-p484/bundler/gems/faraday-f4e3fc344072/lib/faraday/connection.rb:358:in `block in build_request' 17:39:54 web.1 | () Users/password123/.rvm/gems/ruby-1.9.3-p484/bundler/gems/faraday-f4e3fc344072/lib/faraday/request.rb:26:in `block in create' 17:39:54 web.1 | () Users/password123/.rvm/gems/ruby-1.9.3-p484/bundler/gems/faraday-f4e3fc344072/lib/faraday/request.rb:25:in `create' 17:39:54 web.1 | () Users/password123/.rvm/gems/ruby-1.9.3-p484/bundler/gems/faraday-f4e3fc344072/lib/faraday/connection.rb:354:in `build_request' 17:39:54 web.1 | () Users/password123/.rvm/gems/ruby-1.9.3-p484/bundler/gems/faraday-f4e3fc344072/lib/faraday/connection.rb:340:in `run_request' 17:39:54 web.1 | () Users/password123/.rvm/gems/ruby-1.9.3-p484/bundler/gems/faraday-f4e3fc344072/lib/faraday/connection.rb:133:in `get'
如果我使用
curl -X GET路径
我得到的答复我validate