I wanted to send code to some node application and I use the postman with post message and in the body I put the following:
module.exports = function() {
var express = require('express'),
app = express();
app.set('port', process.env.PORT || 3000);
return app;
}
in the header of the request I put
content-Type application/text/enriched
in the node code I use the following
module.exports = function (app) {
fs = require('fs');
var bodyParser = require('body-parser');
...
app.post('/bb',function(req,res){
var fileContent = req.body
and the file content is empty ,I was able to see that it works since it stops in debug
If you want to add a custom content type then you need to keep two things in mind:
See the example:
You can test in your console with curl:
I recommend you try to not use a custom content type header because things are easier. I hope that my explanation help you.