小编ooC*_*Ioo的帖子

在kotlin中改造2 @headers错误

我尝试添加多个静态标头与改造2(2.3.0),如下所示:

interface WeatherAPI {

    @Headers({
        "Accept: application/json",
        "Content-type:application/json"
    })
    @GET("/data/2.5/weather")
    fun getWeatherForCityName(@Query("q") city: String, @Query("appid") appid: String) : Call<GetWeatherResponse>;

}
Run Code Online (Sandbox Code Playgroud)

我有以下错误:

错误

知道我的错误吗?

android kotlin retrofit2

11
推荐指数
3
解决办法
5085
查看次数

标签 统计

android ×1

kotlin ×1

retrofit2 ×1