简体   繁体   中英

CORS policy: Method DELETE is not allowed by Access-Control-Allow-Methods in preflight response

POST, GET are fine but its just DELETE Method is always be blocked by CORS any solution about this?

This is for my CORS setup in Server:

I tried to call the method from Front End with Axios

This is the error from console

Try this code

app.use(cors({origin : "http://localhost:3001",methods : ["GET","POST","PUT","DELETE"],optionsSuccessStatus: 200}));

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM