Retrofit实现Delete请求
2024-08-23 04:21:34
//设置取消关注
@Headers("Content-Type:application/x-www-form-urlencoded")
@HTTP(method = "DELETE", path = Constant.NEWATTENTION, hasBody = true)
@FormUrlEncoded
Call<ResultInfo> setNotAttention(@Field("user_id") String user_id, @Field("token") String token, @Field("attu_id") String attu_id, @Field("type") String type);
1、首先要设置请求头 application/x-www-form-urlencoded
2、设置请求的方法 因为默认delete请求是不能带body的 所以需要单独设置为true
最新文章
- Windows Azure一些小技巧集合
- Android USB Host与HID通讯
- pvoid64 pvoid
- UIGestureRecognizer
- Sphinx 实时索引
- MVC 详细说明
- Dom操作的分类
- iOS学习笔记: 使用CAShapeLayer创建带有空心区域的遮罩层
- Memcache+Cookie解决分布式系统共享登录状态------------------------------Why Memcached?
- 动态规划:最长上升子序列(LIS)
- Firemonkey使用iOS的第三方静态库(Link Binary With Libraries)
- 一句话解释JVM中空间分配担保的问题
- Mysql基本操作整理
- MyBatis打印SQL执行时间
- 学习ASP.NET Core Razor 编程系列十二——在页面中增加校验
- php 积分抽奖活动(大转盘)
- VMWare Station 问题汇总
- 2013长春网赛1001 hdu 4759 Poker Shuffle
- java解析XML之DOM解析和SAX解析(包含CDATA的问题)
- 一段javascript设计模式应用场景
热门文章
- iOS 两个tableview的 瀑布流
- codeforces 469B Chat Online 解题报告
- laravel基础课程---2、Laravel配置文件、路由及php artisan(php artisan是什么)
- 最小点覆盖 hdu--1054
- Java中的final和static
- HTTP Status 500 - Write operations are not allowed in read-only mode (FlushMode.MANUAL): Turn your Session into FlushMode.COMMIT/AUTO or remove &#39;readOnly&#39; marker from transaction definition.
- linux下配置jdk+tomcat
- linux命令:wc命令
- css3单位em,rem,px,vw,vh等
- CodeForces 1109E. Sasha and a Very Easy Test