I would like to send a Buffer through Http response, but on the client I receive it as string instead of Buffer. I use expressjs router, as below code
router.get('/', function(req, res, next) {
const buf = new Buffer('Hello world');
console.log(buf); // gives me <Buffer 48 65 6c 6c 6f 20 77 6f 72 6c 64>
res.send(buf); // gives me 'Hello world'
});
In the above code my expected result was Buffer () but I get the String output 'Hello World.
Someone help me out. Thanks in advance.
buffer, so it can't use it.