【发布时间】:2012-01-24 21:27:27
【问题描述】:
我正在尝试使用我编写的脚本向 Yahoo Placefinder API 发出请求,我希望它返回 JSON。但是,所有请求都发回 XML。话虽如此,当我在浏览器中运行相同的脚本时,我得到了预期的 JSON 数据。以下是我的要求:
wget http://where.yahooapis.com/geocode?location=San+Francisco,+CA&flags=J&appid=yourappid
curl http://where.yahooapis.com/geocode?location=San+Francisco,+CA&flags=J&appid=yourappid
非常感谢任何帮助。这很令人沮丧,而且看起来应该很容易解决!
【问题讨论】:
-
curl -X GET "http://where.yahooapis.com/geocode?location=San+Francisco,+CA&flags=J"时无法获取 JSON,您是否缺少参数? -
解决了!缺少 curl 参数。将此作为答案,我会将其标记为已回答!
标签: json http curl wget yahoo-api