我在我的项目中使用这个Volley版本实现'com.mcxiaoke.volley:library-aar:1.0.0'
并且它工作正常,但是今天我发现它没有来自服务器的响应包含以下错误代码:
E/Volley: [4722] BasicNetwork.performRequest: Unexpected response code 303 for http://....other_link_part
当我点击链接时,我发现它工作正常,并且 json 成功地显示在浏览器上。
最佳答案
当我手动处理从 https 到 http 的切换时,当我的链接是 https 时,我遇到了这样的问题,证书有问题
com.android.volley.NoConnectionError:javax.net.ssl.SSLHandshakeException:java.security.cert.CertPathValidatorException:未找到证书路径的信任 anchor ,因此在检查与服务器的连接时它似乎已断开连接,并且链接架构更改为当我发现 https 证书错误并解决如下链接时,http 会给出 303 错误代码: Android volley error: "Trust anchor for certification path not found", only in real device, not emulator一切正常。
所以我的建议 - 确保您已连接到服务器的正确链接模式(如果有) (http 或 https) - 检查截击错误消息 - 如果证书有问题,请先尝试解决它
希望能解决您的问题
关于java - 意外响应代码 303 Volley 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55088917/