fetch(url, {
method,
mode: 'cors',
headers: {
"Test": "2222"
}
})
.then(response => response.json())
Interface 404
淡淡烟草味2017-05-19 10:49:35
var headers = new Headers();
headers.append('Accept', 'application/json');
var request = new Request(URL, {
headers: headers,
method:"GET"
});
fetch(request).then(function(response) {
console.log(response);
});
It seems that the headers object is sent, and it seems that your method does not have a value. The 404 is because your url does not exist. Test it with postman first.