这个问题在这里已经有了答案:
How to escape hash character in URL
(1 个回答)
去年关闭。
我有一个带 Spring Boot 的休息 Api :
PageableResult<List<T>> search(HttpServletRequest request, HttpServletResponse response){
Map<String, String[]> params = request.getParameterMap();
log.info("params: {}", params);
return getService().search(params);
}
但是当我使用 postman 时
在服务功能中,使用下面的代码时我什么也没有。
String resultat = params.get("resultat");// I have nothing with resultat
那么参数以“#”符号开头会发生什么。如何解决?
最佳答案
您将需要使用 %23
通过#
作为一个角色。
Here是一个将您的关键字转换为必要格式的网站。
关于java - 无法传递以# 开头的参数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60756141/