HTTP Status 400 – Bad Request Type Status Report Description The server cannot or will not process the request due to something that is perceived to be a client error

我碰到这个问题时的场景是这样的:

前端页面跳转时,将一些数据放在url中,再到下个页面去接收,代码是这样的

HTTP Status 400 – Bad Request Type Status Report Description The server cannot or will not process the request due to something that is perceived to be a client error

 

 之前在红框的地方之前直接写的 url,自己在idea上本地开发的时候,没有出现问题,但是发布到服务器上之后就报了400的错误,发现当所传数据中含有非法字符时就会报错,跟tomcat版本好像有关,因为服务器上的tomcat版本最近升级到9.0.43版本了。

然后用了encodeURI()转义函数就好了,希望对大家有帮助.

HTTP Status 400 – Bad Request Type Status Report Description The server cannot or will not process the request due to something that is perceived to be a client error

上一篇:Edge 浏览器如何查看当前网站的 SSL 证书


下一篇:python 自动生成100万ip列表