欢迎光临
感受代码之美

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

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

转载请注明来源:四个空格 » Content type ‘application/x-www-form-urlencoded;charset=UTF-8’ not supported解决

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址