1

I'm trying to send GET request with faraday

 @resp = begin
   connection.get(path, data)
  rescue Exception => e
    []
  end

if i remove rescue part, i get

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'

If i use

curl -X GET path

I get response which i can validate

Elmor
  • 4,775
  • 6
  • 38
  • 70

0 Answers0