/**
* 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

使用Retrofit时出现 java.lang.IllegalArgumentException: URL query string "t={type}&p={page}&size={count}" must not have replace block. For dynamic query parameters use @Query.异常原因的更多相关文章

  1. Eclipse启动Tomcat时发生java.lang.IllegalArgumentException: <session-config> element is limited to 1 occurrence

    在学习struts 2时,为了方便,直接从下载的struts的apps目录下的struts2-blank.war压缩包下的WEB-INF\复制的web.xml,当我启动Tomcat时,发生 java. ...

  2. 在访问jsp时抛java.lang.IllegalArgumentException: Page directive: invalid value for import的原因

    问题:java.lang.IllegalArgumentException: Page directive: invalid value for import 环境:tomcat 7.0.65 出错原 ...

  3. 压缩/解压 zip 时遇到 java.lang.IllegalArgumentException: MALFORMED

    因为zip文件名为中文,或者压缩内容有中文 解决方法: 错误详情: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinde ...

  4. selenium 使用键盘时 提示java.lang.IllegalArgumentException: Key Down / Up events only make sense for modifier keys.

    输入某个内容后,使用enter键进行确认,最开始使用方式为: driver.findElement(By.xpath("//input[@name='supplier_name'][@id= ...

  5. java.lang.IllegalArgumentException: Invalid source 'classpath:spring-mvc.xml'

    今天在跑项目时遇到java.lang.IllegalArgumentException: Invalid source 'classpath:spring-mvc.xml'报错,自己也是摸索了很久,一 ...

  6. 用eclipse部署tomcat时出现异常:java.lang.IllegalArgumentException

    用eclipse部署tomcat时出现异常:java.lang.IllegalArgumentException: Invalid 'log4jConfigLocation' parameter: c ...

  7. java.lang.IllegalArgumentException: No Retrofit annotation found. (parameter #1) for method ApiService.getMethod

    @FormUrlEncoded @POST("getMethod") Observable<Bean> getMethod(String field); 今天在写Ret ...

  8. 解决FTP的URL访问不能有中文名称的问题,报java.lang.IllegalArgumentException

    最近一个项目要用到FTP做上传下载,我访问ftp的url中有中文名称,结果每次都报如下错: 1 Exception in thread "main" java.lang.Illeg ...

  9. 图片缩放时java.lang.IllegalArgumentException: pointerIndex out of range解决方案

    版权声明:本文为博主原创文章,未经博主允许不得转载. 06-03 20:45:24.143: E/AndroidRuntime(1230): FATAL EXCEPTION: main06-03 20 ...

随机推荐

  1. 使用VisualSVN Server自动发布站点

    使用VisualSVN Server自动发布站点可以节省大量的发布时间. 适用于项目测试版本 通常一个项目在测试阶段会遇到以下问题 1.开发人员修改缺陷要实时反应到测试环境 2.项目经理想让客户及时看 ...

  2. 简单的Datatable转List,Json

    这里用到了Newtonsoft.Json,下载地址:http://json.codeplex.com/ 1.根据不同的Model转为对应的List public static List<Mode ...

  3. asp.net 生成PDF方法

    今天转博客园看到有人发表了一篇生成PFd的文章,准备自己也留一份准备以后用到的时候方便调用: 首先去itextsharp网站下载控件(https://sourceforge.net/projects/ ...

  4. cadence16.6 如何对齐元件

    1.选中Setup-->Application Mode-->Placement Edit mode2.按"CTRL"键,选中需要对齐的所有对象.3.点击右键右,或者在 ...

  5. Msys+Mingw在手 妙用在心!

    1 缘起 平时在一些c++群面,看见很多大学十分努力的学习c++/MFC ,看见在编程语言百花争芳的时候,C/C++还是很有很有魅力.估计很多初学者使用都是window下的visual stdio 开 ...

  6. .net视图中日期格式化

    昨天在做一个功能,要在界面上按照规定的格式显示一个时间,如果直接在expression那里格式化的话(如下:) @Html.DisplayFor(c => Convert.ToDateTime( ...

  7. iOS 进阶 第十二天(0413)

    0413 - Quartz2D 使用Quartz2D画图形步骤:(drawRect: 方法 是 在view第一次显示到屏幕上的时候会调用一次.是系统主动去掉用的,不能直接调用.那么问题来了,比如我要通 ...

  8. Careercup - Facebook面试题 - 5729456584916992

    2014-05-02 00:59 题目链接 原题: Given a normal binary tree, write a function to serialize the tree into a ...

  9. HTML弹出窗口

    1.最简单的 <script type="text/javascript"> <!-- window.open("http://cn.bing.com& ...

  10. [resource-]Python 网页爬虫 & 文本处理 & 科学计算 & 机器学习 & 数据挖掘兵器谱

    reference: http://www.52nlp.cn/python-%e7%bd%91%e9%a1%b5%e7%88%ac%e8%99%ab-%e6%96%87%e6%9c%ac%e5%a4% ...