I try to return some binary data with Express. In the example, it\'s a PDF but theorically, this can be any sort of file.
But focus on the pdf for the moment. I wrot
I found a more simple solution :
request(req.url).pipe(res);
This pipes the original response from distant Web Service directly to my response! I got the correct file regardless of the file type.