POST API 怎么可能在 Postman 中工作而不是在改造中工作? [英] How is it possible that POST API working in Postman but not the retrofit?

查看:37
本文介绍了POST API 怎么可能在 Postman 中工作而不是在改造中工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用一个登录 API,它也需要一些标题和正文.在最新版本的改造中,我尝试以注释或编程方式以两种方式发送标头,但每次都显示错误代码 417、异常失败且错误正文为空,但在邮递员中我得到了适当的响应.

I'm trying to hit one login API, which also need some headers and body. with the latest version of retrofit, I tried to send headers in both way either with annotation or programatically way, but everytime it says error code 417, exception failed and error body is null, but in postman I'm getting proper reponse.

推荐答案

你可以使用 HttpLoggingInterceptor 来比较请求并找出问题所在.

you can use HttpLoggingInterceptor to compare requests and find out what is wrong.

这篇关于POST API 怎么可能在 Postman 中工作而不是在改造中工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆