This is a misunderstanding-- cors cross-domain put request, options report 404

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.

clipboard.png

clipboard.png

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;
  });
Apr.07,2021

if you confirm that the address of your request is correct and that the request exists cross-domain,
add OPTION request to the response header Access-Control-Allow-Methods .
currently you have no option request configured in the response header.
clipboard.png

Menu