org.springframework.web.HttpMediaTypeNotSupportedException: Content type ‘application/x-www-form-urlencoded;charset=UTF-8’ not supported
解决方法:
ajax加上参数contentType: “application/json;charset=UTF-8”
本文详细解析了在使用SpringMVC框架时遇到的org.springframework.web.HttpMediaTypeNotSupportedException异常,特别是当Content-Type为‘application/x-www-form-urlencoded;charset=UTF-8’时的错误场景,并提供了将ajax请求的ContentType更改为‘application/json;charset=UTF-8’的解决方案。
org.springframework.web.HttpMediaTypeNotSupportedException: Content type ‘application/x-www-form-urlencoded;charset=UTF-8’ not supported
解决方法:
ajax加上参数contentType: “application/json;charset=UTF-8”
1779
1万+
5075

被折叠的 条评论
为什么被折叠?