/** * 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); }
這裏報錯app
形如?t=1&p=2&size=3的url連接不能用@PATH註解url
Query params have their own annotation which automatically appends to the URL.spa
使用@Query註解code
@GET("digest") Call<List<GanChaiEntry>> ListGanchaiEntry(@Query("t")int type , @Query("size") int count, @Query("p") int page);
參考:blog
http://stackoverflow.com/questions/24610243/retrofit-error-url-query-string-must-not-have-replace-blockstring