Content type ‘application/x-www-form-urlencoded;charset=UTF-8‘ not supported解决方法

Content type ‘application/x-www-form-urlencoded;charset=UTF-8‘ not supported解决方法

微信小程序前端页面传递参数到后端(springboot),出现Content type ‘application/x-www-form-urlencoded;charset=UTF-8‘ not supported报错,可尝试将后端接收参数时添加@RequestParam

public String meetOrder(@RequestParam("member") List<String> member){
    	...
}

对应的小程序端如下:


```javascript
wx.request({
   url: '...',
   method: "POST",
   data: {
       member: members,
       },
   header: {
     'content-type': 'application/x-www-form-urlencoded',
     'Authorization': app.globalData.Authorization
   },
   success: (res) => {
   		...
   }
 })

成功

你可能感兴趣的:(小程序,spring,boot,前端,后端)