Ajax请求中contentType和dataType的区别
最近做项目用到了ajax,做一些必要的笔记,一来是对自己学习的知识的巩固,二来对有同样问题的人有参考作用contentType:(默认: “application/x-www-form-urlencoded”) 发送信息至服务器时内容编码类型。默认值适合大多数情况。如果你明确地传递了一个content-type给 $.ajax() 那么他必定会发送给服务器(即使没有数据要发送).其他可选的类型有:form-data x-www-form-orlencoded raw binary等d.
原创
2020-06-18 22:03:16 ·
606 阅读 ·
0 评论