关于ajax、axios的请求格式后端接收的注意点
首先区分contentType和dataType
$.ajax({
dataType: 'json',
contentType: 'application/json',
data: JSON.stringify({a: [{b:1, a:1}]})
})
contentType: 告诉服务器,我要发什么类型的数据
dataType:告诉服务器,我要想什么类型的数据,如果没...
原创
2020-02-28 22:53:18 ·
305 阅读 ·
0 评论