fetch(url, {
method: "POST",
mode: "no-cors",
headers: {
"Content-Type": "application/x-www-form-urlencoded"
},
body: "请求参数"
}).then(function(res) {
console.log("Response succeeded?", JSON.stringify(res.ok));
console.log(JSON.stringify(res));
}).catch(function(e) {
console.log("fetch fail", JSON.stringify(params));
});
method: "POST",
mode: "no-cors",
headers: {
"Content-Type": "application/x-www-form-urlencoded"
},
body: "请求参数"
}).then(function(res) {
console.log("Response succeeded?", JSON.stringify(res.ok));
console.log(JSON.stringify(res));
}).catch(function(e) {
console.log("fetch fail", JSON.stringify(params));
});