post请求组成

param

对应的springboot代码(?)
@Controller
public class hellocontrller {
@ResponseBody
@RequestMapping("hello")
public String f(@RequstParam String a){
return "header"+a;
}
Header

header中有这些键值对,设置了一些请求的方式
如果要在springboot中获取这里的键值对
@Controller
public class hellocontrller {
@ResponseBody
@RequestMapping("hello")
public String f(@RequestHeader String a){
return "header"+a;
}
}
body

对应@RequestBody,在contreller中只能用实体类接收,还需设置header具体见
https://blog.youkuaiyun.com/hui008/article/details/80476013
public void downloadAllClassmate(@RequestBody Tb1 tb1, HttpServletResponse response)
本文详细介绍了如何在SpringBoot应用中处理POST请求的各种组成部分,包括参数(param)、请求头(header)及请求体(body)的处理方式,并给出了具体的代码示例。
1276

被折叠的 条评论
为什么被折叠?



