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 doesn't seem to be any problem, but in reality, URLs do not support special characters such as +, spaces, /, ?, %, #, &, =, 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 avoid using URL path parameters and instead use form parameters in the body.