fetch(
'/api/user/newsDetail', {
method:
'post',
headers: {
"Content-type":
"application/x-www-form-urlencoded; charset=UTF-8"
},
body:
'foo=bar&favColor=blue&password=easytoguess'
})
.
then(response =>
response.json())
.
then(
function (data) {
console.log(data);
})
.
catch(
function (error) {
console.log(
'Request failed', error);
})
转载请注明原文地址: https://www.6miu.com/read-41938.html