title: How to request images and output image in Node.js
body: <p>I try to get the image and display on a url. and I use <a href="https://github.com/request/request" rel="nofollow">request</a> module.</p>
  
  <p>For example, I want to get the image <code>https://www.google.com/images/srpr/logo11w.png</code>, and display on my url <code>http://example.com/google/logo</code>.</p>
  
  <p>Or display by <code>&lt;img src="http://example.com/google/logo" /&gt;</code>.</p>
  
  <p>And I try to use <strong>request</strong> and <strong>express</strong>:</p>
  
  <pre><code>app.get("/google/logo", function(req, res) {
    request.get("https://www.google.com/images/srpr/logo11w.png", 
          function(err, result, body) {
      res.writeHead(200, {"Content-Type": "image/png"});
      res.write(body);
      res.end();
    })
  })
  </code></pre>
  
  <p>but the response is not a image. How to get image and output? </p>
  
  <p>Please give me some suggestion about the question. THANKS.</p>