我正在尝试使用我编写的脚本向 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
任何帮助深表感谢。这很令人沮丧,而且看起来应该很容易解决!