在浏览器用get方式请求后面带json数据,localhost:8080/Hello/json?data={...},报错,Note: further occurrences of HTTP header parsing errors will be logged at DEBUG level.
java.lang.IllegalArgumentException: Invalid character found in the request target. The valid characters are defined in
这是因为请求数据的字符问题,翻译一下“Invalid character found in the request target”这句话,请求目标中发现无效字符,在RFC 7230 and RFC 3986中定义了{}和一些其他字符是不在保留字段中的,需要转义,如‘{’需要转义成%7B,‘}’要转义成%7D,所以get请求就变成了localhost:8080/Hello/json?data=%7B...%7D,参考点击打开链接,本来还找到个很详细的转义列表的,找不到了,很难受