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

hutuyun-ad-banner.png ai-qy.gif

Spring报错:org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported,具体解决办法如下:

@PostMapping( "some/request/path" )
public void someControllerMethod( @RequestParam Map<String, String> body ) {
  //work with Map
}

参数前加@RequestParam。

参考:Content type ‘application/x-www-form-urlencoded;charset=UTF-8’ not supported for @RequestBody MultiValueMap

赞(0)
未经允许禁止转载:优米格 » Content type ‘application/x-www-form-urlencoded;charset=UTF-8’ not supported解决

评论 抢沙发

合作&反馈&投稿

商务合作、问题反馈、投稿,欢迎联系

广告合作侵权联系