title: Stream file to user for download in Node/Express
body: <p>I would like to ask you for help with REST API in Node / Express.</p>
  
  <p>I'm calling a vendor API to get a label in PDF format, and then I need to send it to a user which is calling the API.</p>
  
  <p>I'm using the <code>request</code> npm package to call another API. I have also tried <code>node-fetch</code> but with no luck.</p>
  
  <p>Example code:</p>
  
  <pre><code>retrieveLabel(req, res, next) {
    const options = {
      method: 'GET',
      url: 'apiUrl' + 'shipments/xxx/label',
      headers: {
        'cache-control': 'no-cache',
        authorization: xxxToken,
        'content-type': 'application/json'
      }
    };
    request(options, (error, response, results) =&gt; {
      // NO idea how to send it as reponse...
  
  
    });
  }
  </code></pre>
  
  <p>In console there is response with type string, starting with something like this:</p>
  
  <pre><code>%PDF-1.4
  %����
  3 0 obj
  &lt;
  &lt;/Type /XObject /Subtype /Image /Width 1171 /Height 1676 /ColorSpace /DeviceRGB /BitsPerComponent 8 /Decode [0 1 0 1 0 1] /Interpolate false /Filter /FlateDecode /DecodeParms&lt;
  &lt;/Predictor 12 /Colors 3 /Columns 1171 &gt;&gt;
   /Length 61782 &gt;&gt;
  stream
  X���o�]�}'�;!Yl"�ɠh����x�H&amp;�r�h�@(�3[ҋHK"�r+)K�q{kYL���fl���H�)��@�By�v�Ԭ\Z��3�-�5�Զ*PEJ���EU�����G�Ϲ�v���t��S��n���s�sn��&gt;�y���1y��y��r'��Nrȝ��;�
   wݓ�Ν;�m��b�X,��b�X,s�D �MO?�܊,6@rK&amp;''w����b���266�H�%��_~��r�C���X,�e�K��������U��۲e���%+�������|���*��?pr �@�$7��In���r'��Nrȝ�0���o���|עʑ#Gn�������u�s��Z���ɓqe��|U &gt;��9z�%�ٳw
  ....
  </code></pre>