1
有下面的代码:757意外标记错误的Rails
source = 'https://api.vk.com/method/users.get?access_token=sometoken'
response = JSON.parse(source)
render json:response
这个网址返回正确的JSON,但我有例外:“757:在‘https://api.vk.com/method/users.get?access_token=sometoken’意外的标记”。我不明白它为什么会出现。我该如何解决它?
另一种解决方案:JSON.parse(网:: HTTP获得(URI.parse( 'https://api.vk.com/method/users.get?access_token=sometoken'))) –