tomcat : 向后台传 json字符串有可能报400错误
-
原因:
有可能是tomat为了安全吧。把一些特殊字符进行了编码 比如+
会转义成特殊的编码。 会导致400错误 -
解决方法:
找到config/catalina.properties 最后一行,去掉注释#
在最后加一个{}
#tomcat.util.http.parser.HttpParser.requestTargetAllow=|
改为:
tomcat.util.http.parser.HttpParser.requestTargetAllow=|{}
-
亲测可用
- 特意转发 qq_直视太阳的博客. https://blog.csdn.net/qq_37654578 https://blog.csdn.net/qq_37654578/article/details/81189311