org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'application/json;charset=UTF-8' not supported

解决方法:添加

contentType : ‘application/json‘,
$.ajax({
  type: "POST",
  url: "/xxx",
  dataType:‘json‘,
  contentType : ‘application/json‘,
  async : ‘false‘,
  data:{"name":1,"value2":2},
  success:function (data) {    
  }
});

 

org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'application/json;charset=UTF-8' not supported

上一篇:SpringBoot集成slf4j日志配置


下一篇:Java 日志框架:log4j vs logback vs log4j2