我正在使用 Retrofit 进行 API 调用,后端位于 Magento 2 中,我在其中启用了 cookie。但有时我会在服务器响应中收到400 Bad request。这仅适用于 Android。当他们从 postman 调用 API 时,它工作正常。
最佳答案
在 postman 中,从请求正文上方的右上角选择“代码”。这将显示发送到 API 的确切消息(包括 header 、URI、HTTP 方法等)。验证 Android 正在发送相同的内容。
接下来检查系统策略是否允许此类消息传递。
关于java - 在应用程序中,API 响应中收到 400 Bad request,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59046099/