Using express.js, I am parsing all the request bodies as json (app.use(express.json())). I have a single route where I want to parse the body as text, instead of json. How do I create an exception (i.e., parse body as text) for a single route?
Yes, as Chris G mentioned it's a question of the Content-Type header.
According to doc by default express.json middleware looks only to Content-Type: application/json hense if client send other value Content-Type: text/plain the json middleware will not parse it...