我正在尝试使用Retrofit向雅虎申请当前的天气信息。当我试图通过这座城市时,我正面临着一个问题。我知道我必须使用@Query
雅虎的查询有点复杂,我不知道如何进行。这是我的密码
@GET("yql?q=select%20*%20from%20weather.forecast%20where%20woeid%20in%20(select%20woeid%20from%20geo.places(1)%20where%20**text%3D%22brussels%2C%20be%22)%20and%20u%3D%27c%27&format=json&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys")例如,在这个复杂的查询中,我需要将城市参数从text%3D%22brussels%2C%20be更新为text%3D%paris%2C%20fr。
任何帮助都将不胜感激;
提前谢谢你,
发布于 2016-07-06 12:43:05
@GET("yql?q=select%20*%20from%20weather.forecast%20where%20woeid%20in%20(select%20woeid%20from%20geo.places(1)%20where%20**text%3D%22{location}%2C%20be%22)%20and%20u%3D%27c%27&format=json&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys")
Call<response> groupList(@Path("location") String location);如果我正确理解你的问题,这应该是可行的。
https://stackoverflow.com/questions/38224026
复制相似问题