postman 传递 raw 参数错误 org.springframework.web.bind.MissingServletRequestParameterException: Required I

问题描述

使用 postman 传递 raw 参数错误:
org.springframework.web.bind.MissingServletRequestParameterException: Required Integer parameter ‘xxx’ is not present

问题分析

端上传来的 content-type 对应的值为 application/json:
在这里插入图片描述

导致:
在这里插入图片描述

问题解决

端上将 content-type 修改为 application/x-www-form-urlencoded:
在这里插入图片描述

body 参数就会自动变为 x-www-form-urlencoded:
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
org.springframework.web.bind.MissingServletRequestParameterException是Spring框架中的一个异常类,表示请求参数缺失的异常。 该异常通常会在处理HTTP请求时抛出,当请求中缺少必需的参数时,就会引发这个异常。例如,当请求中缺少名为"userId"的字符串类型参数时,就会抛出"Required String parameter 'userId' is not present"的异常信息。这个异常的原因是请求缺少了必需的参数。 在日志中,也可以找到对应异常的记录。比如在2021-04-06 18:29:13.820的日志中,出现了"org.springframework.web.bind.MissingServletRequestParameterException: Required Long parameter ‘enterpriseInfoId’ is not present"的异常信息。这表示在处理请求时,缺少了名为"enterpriseInfoId"的长整型参数。 综上所述,"org.springframework.web.bind.MissingServletRequestParameterException"是Spring框架中的一个异常,表示请求参数缺失的异常。通常情况下,这个异常会在处理HTTP请求时抛出,当请求中缺少必需的参数时,就会引发该异常。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [spring-web-2.5.jar](https://download.csdn.net/download/shenggaofei/10420498)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *2* [解决Postman发送请求报错org.springframework.web.bind.MissingServletRequestParameterException](https://blog.csdn.net/u800820/article/details/122530951)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *3* [org.springframework.web.bind.MissingServletRequestParameterException: Required Long parameter ...](https://blog.csdn.net/weixin_47056195/article/details/115496096)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

悄悄地努力

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值