@Field parameters can only be used with form encoding
来源:互联网 发布:淘宝手办哪家好 编辑:程序博客网 时间:2024/06/06 03:34
今天在学习Retrofit的时候,当post请求时
public interface NewsDataService{ @POST("news/list") Call<NewsData> getNewsData(@Field("key") String key);}
运行总会报错,报错截图如下:
正确写法如下:
当POST请求时,@FormUrlEncoded和@Field简单的表单键值对。两个需要结合使用,否则会报错
@Query请求参数。无论是GET或POST的参数都可以用它来实现
0 0
- @Field parameters can only be used with form encoding
- @Field parameters can only be used with form encoding
- QT “Timers can only be used with threads started with QThread”的解决办法~
- 解决PyQt错误(QObject::startTimer: QTimer can only be used with threads started with QThread)
- java.lang.IllegalStateException: ActionBarContextView can only be used with android:layout_width="
- ActionBarImpl can only be used with a compatible window decor layout
- <merge /> can be used only with a valid ViewGroup root and attachToRoot=true
- android编译错误之“Hardware acceleration can only be used with a single UI thread”,硬件加速
- java.lang.IllegalStateException: ActionBarImpl can only be used with a compatible window decor layou
- java.lang.IllegalStateException: ActionBarImpl can only be used with a compatible window decor layou
- A TextureView or a subclass can only be used with hardware acceleration enabled.错误原因分析
- java.lang.IllegalStateException: Hardware acceleration can only be used with a single UI thread.
- android.view.InflateException: <merge /> can be used only with a valid ViewGroup root and attachToRo
- Calling latest() can only be used in combination with key(String) and keyLike(String)
- <merge /> can be used only with a valid ViewGroup root and attachToRoot=true
- Hardware acceleration can only be used with a single UI thread
- android R.java居然报错,Underscores can only be used with source level 1.7 or greater
- -pie can only be used when targeting iOS 4.2 or laterclang: error: linker command failed with exit c
- 18. 使用模板【从零开始学Spring Boot】
- android_20_ListView_BaseAdapter
- 快速行驶的自动驾驶,离现实还有多远?
- 程序员面试金典: 9.4树与图 4.3给定一个有序整数数组,元素各不相同且按升序排列,创建一颗高度最小的二叉查找树。 ---快速解法
- SpringMVC常用获取传递参数的方法
- @Field parameters can only be used with form encoding
- SQL Server 存储(2/8):理解数据记录结构
- 19. Spring Boot 添加JSP支持【从零开始学Spring Boot】
- AST
- gcc4.4.7升级到gcc4.8.0
- keepalived persistence_timeout参数意义 LVS Persistence 参数的作用
- Ubuntu 16.04 安装
- 创建image时服务端产生的对象
- Android JCVideoPlayer视频播放器使用相关(新版JCVideo已经添加相关功能)