使用Retrofit时出现 java.lang.IllegalArgumentException: URL query string "t={type}&p={page}&size={count}" must not have replace block. For dynamic query parameters use @Query.异常原因
/**
* 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.异常原因的更多相关文章
- 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. ...
- 在访问jsp时抛java.lang.IllegalArgumentException: Page directive: invalid value for import的原因
问题:java.lang.IllegalArgumentException: Page directive: invalid value for import 环境:tomcat 7.0.65 出错原 ...
- 压缩/解压 zip 时遇到 java.lang.IllegalArgumentException: MALFORMED
因为zip文件名为中文,或者压缩内容有中文 解决方法: 错误详情: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinde ...
- selenium 使用键盘时 提示java.lang.IllegalArgumentException: Key Down / Up events only make sense for modifier keys.
输入某个内容后,使用enter键进行确认,最开始使用方式为: driver.findElement(By.xpath("//input[@name='supplier_name'][@id= ...
- java.lang.IllegalArgumentException: Invalid source 'classpath:spring-mvc.xml'
今天在跑项目时遇到java.lang.IllegalArgumentException: Invalid source 'classpath:spring-mvc.xml'报错,自己也是摸索了很久,一 ...
- 用eclipse部署tomcat时出现异常:java.lang.IllegalArgumentException
用eclipse部署tomcat时出现异常:java.lang.IllegalArgumentException: Invalid 'log4jConfigLocation' parameter: c ...
- java.lang.IllegalArgumentException: No Retrofit annotation found. (parameter #1) for method ApiService.getMethod
@FormUrlEncoded @POST("getMethod") Observable<Bean> getMethod(String field); 今天在写Ret ...
- 解决FTP的URL访问不能有中文名称的问题,报java.lang.IllegalArgumentException
最近一个项目要用到FTP做上传下载,我访问ftp的url中有中文名称,结果每次都报如下错: 1 Exception in thread "main" java.lang.Illeg ...
- 图片缩放时java.lang.IllegalArgumentException: pointerIndex out of range解决方案
版权声明:本文为博主原创文章,未经博主允许不得转载. 06-03 20:45:24.143: E/AndroidRuntime(1230): FATAL EXCEPTION: main06-03 20 ...
随机推荐
- 使用CSS画一个三角形
<div style="width:0px;height:0px;border-width:40px;border-style:solid;border-color:transpare ...
- Python操作列表的常用方法
下面列出列表常用的方法操作列表以及小例子: 1. Append 在列表末尾添加元素,需在列表末尾添加元素,需要注意几个点: A. append中添加的参数是作为一个整体 & ...
- db2查看表空间
select substr(tbsp_name,1,20) as 表空间名称,substr(tbsp_content_type,1,10) as 表空间类型,sum(tbsp_total_size_k ...
- BitmapSource ConvertTo Bitmap
偶遇需要把 BitmapSource 转成 Bitmap. .. using System; using System.Drawing; using System.Drawing.Imaging; u ...
- 微信公众账号怎么获取微信原始ID
阅读号获取如下,服务号不确定,见图: 进入你的微信公众账号的地址(https://mp.weixin.qq.com ),登录之后进入如下
- 自定义PopupWindow 怎么设置PopupWindow的宽度充满全屏宽度
自定义了一个MyPopMenu类,用于上图中的下拉筛选效果的. 但是按照网上有说需要: new PopupWindow(view,getWindowManager().getDefaultDispla ...
- shell find and rm
按时间删除命令: 删除当前目录下30天以前的所有文件: find . -type f -ctime + -exec rm -fr {} \; 删除当前目录下30天以前的所有目录: find . -ty ...
- BZOJ1692: [Usaco2007 Dec]队列变换
1692: [Usaco2007 Dec]队列变换 Time Limit: 5 Sec Memory Limit: 64 MBSubmit: 594 Solved: 246[Submit][Sta ...
- uva 10269 最短路
求两次最短路 #include <cstdio> #include <cstdlib> #include <cmath> #include <map> ...
- Unity3D脚本中文系列教程(七)
http://dong2008hong.blog.163.com/blog/static/4696882720140311445677/?suggestedreading&wumii Unit ...