前端传递后台的参数包含特殊字符报400错误--encodeURI

str=encodeURI(str);

后台--URLDecoder.decode(str,"UTF-8");

后台加密和解密:

URLEncoder.encode("字符串","UTF-8");//编码(加密);

URLDecoder.decode("解密","UTF-8");//解密

参考链接:https://blog.csdn.net/qq_37788460/article/details/89491203

原文地址:https://www.cnblogs.com/pzw23/p/13579639.html