'PUT Request with content type : text/html not working
I am currently working in node, I need to understand put request method with access control allow headers, Below is my code
import express from 'express';
import cors from 'cors';
const app = express();
var corsOptions = {
origin: '*',
optionsSuccessStatus: 200,
allowedHeaders:['Content-Type: text/html']
}
app.put("/puttest", (req, res) => {
console.log('in put');
res.send({ 'message': ' Hello world !!! app is listening on port '})
});
app.listen(3001, () => {
console.log('Listening to requests on 3001');
});
It is not working why? can you please help me why it is not working when I provide any content-type: application/JSON or text/HTML?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
