/**
 * Created by leo on 16/4/30.
 */
public interface GanchaiService {
    @GET("digest?t={type}&p={page}&size={count}")
    Call<List<GanChaiEntry>> ListGanchaiEntry(@Path("type") int type
            , @Path("count") int count, @Path("page") int page);
}

这里报错

形如?t=1&p=2&size=3的url链接不能用@PATH注解

Query params have their own annotation which automatically appends to the URL.

使用@Query注解

    @GET("digest")
    Call<List<GanChaiEntry>> ListGanchaiEntry(@Query("t")int type
            , @Query("size") int count, @Query("p") int page);

参考:

http://stackoverflow.com/questions/24610243/retrofit-error-url-query-string-must-not-have-replace-block

相关文章:

  • 2022-12-23
  • 2021-10-21
  • 2022-12-23
  • 2022-01-16
  • 2021-06-18
猜你喜欢
  • 2021-04-23
  • 2022-12-23
  • 2022-01-18
  • 2022-12-23
  • 2022-12-23
  • 2021-08-07
  • 2021-09-22
相关资源
相似解决方案