This is my backend interface:
@PostMapping("/test")
public String test(@RequestParam String account) {
return "Hello, World! " + account;
}
This is the frontend request path:
http://localhost:8088/api/test/test?account=[111]
At first glance, there seems to be no problem, but in reality, URLs do not support special characters such as +, space, /, ?, %, #, &, =, etc. If you want to pass parameters by concatenating the request, you must escape these special characters.
Solution 1#
Change the request to:
http://localhost:8088/api/test/test?account=%5B111%5D
Reached the breakpoint
Solution 2#
The best solution is to not use URL path parameters, and instead use form parameters in the body.