Android-改装-查询-Yahoo Weather
作者:互联网
我正在尝试使用Retrofit向Yahoo请求当前天气.
我在试图通过这座城市时遇到一个问题.我了解我必须使用@Query
Yahoo查询有点复杂,我不确定该如何进行.
这是我的代码
@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 =“布鲁塞尔,例如,为text =%paris,fr.
任何帮助将不胜感激;
提前致谢,
解决方法:
@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);
如果我正确理解您的问题,这应该可以工作.
标签:retrofit,weather,yahoo,android 来源: https://codeday.me/bug/20191118/2028213.html