Axios only passes one parameter and does not want to build an additional Java object to receive it. How can the backend accept it most simply?

here is the successful code. I can"t find a more concise way. It is said that this method is not good for mobile phone support

  const data = new URLSearchParams();
    data.append("beUserId", userId);
    axios.post("/user/attention", data)
        .then(response => {
            console.log(response.data)
    })
                

background JAVA code:

@PostMapping("/attention")
@ResponseBody
public String attention(Integer beUserId) {
    System.out.println(beUserId);
    return "";
}
              
Mar.22,2021

axios.post('/user/attention', 'beUserId='+userId)
        .then(response => {
            console.log(response.data)
    })
Menu