Theoretically your solution does work as the RFCs describing the URI and query string imposes no limit. Unfortunately this is not how it was implemented.
Either the client or the server can impose a limit. There is a good SO answer regarding the client's limits. I am not familiar with react's limit as I am mostly focused on backend, you have to research that yourself.
As you use Spring there are two usual server: Tomcat and Netty. Both of them limits the length of the url. Tomcat limits at 8K, Netty at 4K. The list of 1500 integers can be more than those limits.
You have to set a new limit for the backend (for Tomcat the link describes that, for Netty I have never tried that) and hope that the frontend won't expose any limit.
OR...
You can use the @RequestBody
and add that information to the body.
Example (source):
@PostMapping("/request")
public ResponseEntity postController(
@RequestBody LoginForm loginForm) {
curl -i \
-H "Accept: application/json" \
-H "Content-Type:application/json" \
-X POST --data
'{"username": "johnny", "password": "password"}' "https://localhost:8080/.../request"
I would use the @RequestBody
instead of the query parameters as it is designed for such data.