如何使用 requestBody 进行参数传递
作者: llk2yq创建于 2017年12月26日更新于 2020年9月4日
As the title suggests, how can we pass parameters in the form of JSON when making a request at the front end? How can we set the `contentType`? I also tried using `requestBody`, but it failed. I was able to get the request parameters, but I don't know how to convert them into corresponding parameters. Another question is how to validate the API interface parameters, including their types and quantities? When the parameters do not meet the requirements, it does not throw an exception, but returns 400. And so on. I guess I should learn more. I mainly write the front end, so please help me!
内容来源: lihengming/spring-boot-api-project-seed