I am embarrassed to say that I have written the address wrong, please ignore the following
=
it is clear that when a cross-domain PUT request is sent, an options pre-check request will be sent. However, options returns 404. Please take a look at ~
postman, which directly sends a PUT request to OK.
main code:
fetch(url, {
method: "PUT",
credentials: "include",
headers: new Headers({
"Content-Type": "application/json;charset=UTF-8"
}),
body: JSON.stringify({ username: "xxx" })
}).then(function (response) {
console.log(response);
return response.json();
}).then(function (json) {
return json;
});