admin管理员组文章数量:1632834
2021-11-17-308 Permanent Redirect
问题描述:
postman测试接口,数据正常返回,代码当中使用restTemplate调用接口报错,显示308永久的重定向308 Permanent Redirect
postman接口测试
接口地址:
http://gatewayproxy-jcpt.mwr/suser/getLoginUserListBySysId?sysId=10086
postman截图:
报错文字版:
<head><title>308 Permanent Redirect</title></head>
<body>
<center><h1>308 Permanent Redirect</h1></center>
<hr><center>nginx</center>
</body>
</html>
报错截图:
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-HD3qP2Wn-1637132933488)(asserts/image-20211117142424430.png)]
查看header信息:
header信息截图:
文字版:
Location:https://gatewayproxy-jcpt.mwr/suser/getLoginUserListBySysId?sysId=10086
header截图:
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-Pfvzi0EP-1637132933499)(asserts/image-20211117142923133.png)]
报错截图:
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-93Vh8QQN-1637132933503)(asserts/image-20211117142826232.png)]
对比得知
接口调用地址是
http://gatewayproxy-jcpt.mwr/suser/getLoginUserListBySysId?sysId=10086
返回内容当中Header中Location内容为
https://gatewayproxy-jcpt.mwr/suser/getLoginUserListBySysId?sysId=10086
请求由http变成了https,修改代码当中配置,请求https开头的地址,正常访问。
https://gatewayproxy-jcpt.mwr/suser/getLoginUserListBySysId?sysId=10086
请求由http变成了https,修改代码当中配置,请求https开头的地址,正常访问。
问题解决。
版权声明:本文标题:308 Permanent Redirect问题解决 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://m.elefans.com/dongtai/1729149086a1187888.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论