SpringBoot(看我这个) 出现 Content type ‘application/x-www-form-urlencoded;charset=UTF-8‘ not supported

SpringBoot 前端往后台用Jqurey 的ajax传值 出现 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 @ResponesBody有关,我试了都不行
后来看到了一篇文章

解决
在ajax中加一个traditional,如图
我的请求方式是post
SpringBoot(看我这个) 出现 Content type ‘application/x-www-form-urlencoded;charset=UTF-8‘ not supported

ajax 中的traditional介绍

1、
tranditional 在ajax中的作用:当我们设置为true时就能阻止深度序列化,在jq中的ajax它的默认值为false
官方解释 地址:https://jquery.cuishifeng.cn/jQuery.Ajax.html
SpringBoot(看我这个) 出现 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

jQuery.param

地址:https://jquery.cuishifeng.cn/jQuery.param.html
SpringBoot(看我这个) 出现 Content type ‘application/x-www-form-urlencoded;charset=UTF-8‘ not supported

什么是深度序列化

这就需要知道什么是序列化
当我们进行在网络上数据传递交互时,为了防止数据在传输中丢失或者缺少,我们就会用到将文件序列化,并给它一个序列化编号, 为什么又要给他序列化编号了? 就是为了反序列化,就是当我们把数据传给别人的时候,别人就能根据这个序列化编号进行反序列化文件,让他自己能读取到文件的内容

深度序列化

深度序列化就是将文件编码编码再编码 把文件生成非普遍编码形式,再通过一系列程序反序列化得到(个人理解)

以上是通过我自己的学习 通过理解后,通俗的表达,

如果有朋友有发现错误,一定要提出来留言讨论,我是个渴望学习到更多的小码农!!!!!