[Vuejs]-Why does the PUT request give an error using fetch in Vue?

0👍

Your backend accepts CORS POST requests, but not PUT. You should modify the headers set there to include PUT using Access-Control-Allow-Methods response header.

PHP example:

header("Access-Control-Allow-Methods: GET, POST, PUT, OPTIONS");

More info here: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Methods

Leave a comment