The most overlooked solution is to avoid preflight requests altogether. Send simple form data (application/x-www-form-urlencoded or multipart/form-data). As nice as JSON is to work with, it is best to send over flattened values when possible.
JSON and other types not in the above are complex requests, and all will have the pre-flight request.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
but how do we solve this?
I solved it by doing what he said.
npm install cors
var cors = require('cors')
app.use(cors())
Afterwards I was able to make POST requests
Hi, I am doing the same things but still did not resolve this issue. could you please tell what i can do to resolve this errro.
The most overlooked solution is to avoid preflight requests altogether. Send simple form data (application/x-www-form-urlencoded or multipart/form-data). As nice as JSON is to work with, it is best to send over flattened values when possible.
JSON and other types not in the above are complex requests, and all will have the pre-flight request.