watson-ruby
watson-ruby copied to clipboard
Not sure if 401 is the only code that gives nonparseable body? [lib/watson/remote.rb]
filename : lib/watson/remote.rb line # : 109 tag : fix md5 : b547385b20a5543b644943e810e1af76
# [fix] - Not sure if 401 is the only code that gives nonparseable body?
# Figure out what other response codes are bad news for JSON.parse
_json = _resp.code == "401" ? Hash.new : JSON.parse(_resp.body)
debug_print "JSON: \n #{ _json }\n"
# [review] - Returning hash of json + response the right thing to do?
# return {:json => _json, :resp => _resp}
return _json, _resp
end
end
end
end