title: Getting binary content in node.js with http.request
body: <p>I would like to retrieve binary data from an https request.</p>
  
  <p>I found a <strong>similar question</strong> that uses the request method, 
  <a href="https://stackoverflow.com/questions/14855015/getting-binary-content-in-node-js-using-request">Getting binary content in Node.js using request</a>, is says setting <strong>encoding</strong> to <strong>null</strong> should work, but it doesn't.</p>
  
  <pre><code>options = {
      hostname: urloptions.hostname,
      path: urloptions.path,
      method: 'GET',
      rejectUnauthorized: false,
      encoding: null
  };
  
  req = https.request(options, function(res) {
      var data;
      data = "";
      res.on('data', function(chunk) {
          return data += chunk;
      });
      res.on('end', function() {
          return loadFile(data);
      });
      res.on('error', function(err) {
          console.log("Error during HTTP request");
          console.log(err.message);
      });
  })
  </code></pre>
  
  <p>Edit: setting encoding to <strong>'binary'</strong> doesn't work either</p>