0
点赞
收藏
分享

微信扫一扫

#yyds干货盘点# SpringBoot接收 x-www-form-urlencoded格式数据

问题描述:

请求服务端接口但是传参未收到;

解决

使用post请求body数据格式为x-www-form-urlencoded向服务端发起请求 请求成功

#yyds干货盘点# SpringBoot接收 x-www-form-urlencoded格式数据_post请求

但服务端未接收到数据

#yyds干货盘点# SpringBoot接收 x-www-form-urlencoded格式数据_post请求_02

原因是没加@RequestParam注解

@RequestParam用来处理 Content-Type 为 application/x-www-form-urlencoded 编码的内容,Content-Type默认为该属性。

加上@RequestParam后调用 就能接收到值了

#yyds干货盘点# SpringBoot接收 x-www-form-urlencoded格式数据_数据格式_03





举报

相关推荐

0 条评论