【问题标题】:TypeError: can't convert Net::HTTPOK into StringTypeError:无法将 Net::HTTPOK 转换为字符串
【发布时间】:2012-03-10 07:51:06
【问题描述】:

我正在使用 net/httpjson 使用 google 的地理编码 API 对地址进行地理编码。这是引发错误的地方:

response = Net::HTTP.get_response(URI.parse(url))
result = JSON.parse(response)

响应属于 Net::HTTPOK 类,但我想访问实际的 JSON 响应数据(不仅仅是状态码)。

【问题讨论】:

    标签: ruby json net-http google-geocoding-api


    【解决方案1】:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-10-24
      • 2015-03-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多