【发布时间】:2021-01-12 18:45:05
【问题描述】:
我在我的应用程序中使用 Retrofit2 和 RxJava。我必须传递与单个键对应的多个值。以下是我的请求网址
https://api.openweathermap.org/data/2.5/onecall?lat=28.46&lon=77.03&exclude=hourly,alerts,minutely&appid=01s
现在在上面的 URL 中有 exclude 键,其中传递了多个参数,如何在我的界面中添加这些参数。下面是我的界面。
ApiService.class
interface ApiService {
@GET("data/2.5/onecall")
fun getCurrenttemp(@Query("lat") lat:String,
@Query("lon") lon:String,
@Query("exclude") exclude:String,
@Query("appid") appid:String):Observable<Climate>
}
我怎样才能提出想要的请求?
【问题讨论】:
标签: android kotlin retrofit2 rx-java2