Retrofit API的GET?

https://api.heweather.com/x3/weather?cityid=城市ID&key=XXXXXXXXX
这种API 如何用Retrofit 来书写呢

@GET("x3/weather?cityid={cityid}&key={apikey}") Call<WeatherResult> WeatherGet(@Path("cityid") String id,@Path("apikey") String key);

这样写 被提示要使用`@Query("cityid") String id`

Call<WeatherResult> WeatherGet(@Query("<爱尬聊_头条百科>cityid") String id,@Path("apikey") String key);

修改完后 又被提示 Path 不能放在 Query后面

那么我想问这样的API 如何写呢


刘3192988467 1天前

https://futurestud.io/tutoria... 根据这个来看应该就是这么写吧


编辑 举报 2023-04-19 12:10

0个评论

暂无评论...
验证码 换一张
相关内容