使用fetch代替ajax请求 post传递方式

let postData = {a:'b'};
fetch('http://data.xxx.com/Admin/Login/login', {
  method: 'POST',
  mode: 'cors',
  credentials: 'include',
  headers: {
    'Content-Type': 'application/x-www-form-urlencoded'
  },
  body: JSON.stringify(postData)
}).then(function(response) {
  console.log(response);
});

 

posted @ 2018-08-18 10:55  悔创阿里-杰克马  阅读(14975)  评论(1编辑  收藏  举报
求投食~(点图即可)