title: Sending image file from http request in Node.js
body: <p>I am trying to setup an API that will return an image from my google places API using google's photo reference ID as a parameter.  This is what I have so far:</p>
  
  <pre><code>module.exports.getPhoto=function(req,res){
      var id=req.params.id;
  
      var url='https://maps.googleapis.com/maps/api/place/photo?maxwidth=400&amp;photoreference='+id+'&amp;key='+process.env.GOOGLEAPI;
  
      request.get(url, function (err,response,body) {  
        if(err){
          res.status(400).json(err);
        }else{
           res.send(body);
        }    
      });
  };
  </code></pre>
  
  <p>Right now the body is not sending in the correct format.  Is there a way to do this with out saving it as a file and then sending it? </p>