package org.example.controller.requestparam;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class RequestBodyController
{
// http://localhost:8080//getRequestBody post请求,请求体以A=B&C=D的形式打印出来
/**
* 通过 RequestBody 获取post请求体
* @param
* @return
*/
@RequestMapping("/getRequestBody")
public String requestParam(@RequestBody String body) {
System.out.println(body);
return "cheng_gong";
}
}