一:application/x-www-form-urlencoded
浏览器原生form表单,post最常见格式,参数格式为para=value¶2=value2;应用后台默认也是处理这种格式参数
eg:PostMapping
@PostMapping("/hello")
public String hello(@RequestParam("name") String name,
@RequestParam("age") Integer age) {
return "name:" + name + "\nage:" + age;
}
二:application/json
需要后台先将body stream 格式化成json对象,然后读取参数