Illegal character in query at index 27: https://www.baidu.com/s?wd= memeda
·
url中不能直接写特殊字符 必须转码才可以
public URI postParam(@RequestBody Person person, HttpServletResponse response) throws Exception {
String param1 = URLEncoder.encode("https://www.baidu.com/s?wd="+person.getName(), "UTF-8");
URI uri = new URI(param1);
response.addHeader("Location", uri.toString());
return uri;
}
更多推荐
所有评论(0)