问题描述
使用 postman 传递 raw 参数错误:
org.springframework.web.bind.MissingServletRequestParameterException: Required Integer parameter ‘xxx’ is not present
问题分析
端上传来的 content-type 对应的值为 application/json:
![在这里插入图片描述](https://i-blog.csdnimg.cn/direct/f95c78a9d4bd4e0a8b9a6b1a098e8f94.png)
导致:
![在这里插入图片描述](https://i-blog.csdnimg.cn/direct/e32b1d815cac4f7784e778921b00fa3c.png)
问题解决
端上将 content-type 修改为 application/x-www-form-urlencoded:
![在这里插入图片描述](https://i-blog.csdnimg.cn/direct/33e53c15747646358df891b6b7f7ec43.png)
body 参数就会自动变为 x-www-form-urlencoded:
![在这里插入图片描述](https://i-blog.csdnimg.cn/direct/8d995d8cd09f4008a0e8c1c2c29594db.png)