Error parsing HTTP request header 问题解决C 7230 and RFC 3986

问题原因:

查资料了解到最新的tomcat6 7 8 都有这个问题,这个问题是由于tomcat的新版本增加了一个新特性,就是严格按照 RFC 3986规范进行访问解析,
 而 RFC 3986规范定义了Url中
 只允许包含英文字母(a-zA-Z)、数字(0-9)、-_.~4个特殊字符以及所有保留字符(RFC3986中指定了以下字符为保留字符:! * ’ ( ) ; : @ & = + $ , / ? # [ ])。

所以 如果你的请求是这样的

http://127.0.0.1:8080/apiStudy/api?method=bit.api.user.getUser&params={"userId":111} 改为下面的  

具体转义对照表,可百度。

http://127.0.0.1:8080/apiStudy/api?method=bit.api.user.getUser&params=%7B%22userId%22:111%7D

原文:   https://blog.csdn.net/IndexMan/article/details/78058021

猜你喜欢

转载自blog.csdn.net/bestxianfeng163/article/details/81873945
今日推荐