Handling text/plain in Express (via connect)?

前端 未结 5 784
轻奢々
轻奢々 2020-12-15 01:37

I am using Express 3, and would like to handle text/plain POSTs.

Express 3 uses connect\'s bodyParser now (I think the old Express code got moved t

5条回答
  •  既然无缘
    2020-12-15 02:25

    With bodyParser as dependency, add this to your app.js file.

    var bodyParser = require('body-parser');
    var app = express();
    app.use(bodyParser.text());
    

    Happy Noding.

提交回复
热议问题