您现在的位置:首页 >> 前端 >> 内容

在ajax中设置header的Content-Type两种类型的区别讲解

时间:2018/6/9 15:30:55 点击:

  核心提示:post给服务器的数据类型是string,content-type有两种类型1、application/json发送给服务器的数据,会对数据进行JSON序列化2、application/x-www-f...

post给服务器的数据类型是string,content-type有两种类型

1、application/json

发送给服务器的数据,会对数据进行JSON序列化

2、application/x-www-form-urlencoded

发送给服务器的数据,会将数据转化成query string

也就是说,content-type使用哪种类型,区别于服务器是怎么解析数据的。

Tags:在A AJ JA AX 
作者:网络 来源:ppx2017的博客