一、介绍
@RequestBody用于获取请求体中的数据,其属性required默认为true。
二、项目测试
(1)编写Controller类
@ControllerpublicclassMyController{@RequestMapping(value={"/hello"})publicStringhello(@RequestBodyString body,String username,String password){System.out.println(body);System.out.println(username+ password);return"hello";}}
(2)运行