Retrofit: multiple query parameters in @GET command?

后端 未结 4 1099
误落风尘
误落风尘 2020-12-23 09:30

I am using Retrofit and Robospice to make API calls in my android application. All @POST methods work great, and so do @GET commands without any parameters in the URL, but I

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-23 09:48

    Do not write your Query params in GET-URL. Do it like this:

    @GET("/my/api/call")
    Response getMyThing(@Query("param1") String param1,
                        @Query("param2") String param2);
    

提交回复
热议问题