title: stream response from nodejs request to s3
body: <p>How do you use <a href="https://github.com/request/request" rel="noreferrer">request</a> to download contents of a file and directly stream it up to s3 using the aws-sdk for node?</p>
  
  <p>The code below gives me <code>Object #&lt;Request&gt; has no method 'read'</code> which makes it seem like request does not return a readable stream...</p>
  
  <pre><code>var req = require('request');
  var s3 = new AWS.S3({params: {Bucket: myBucket, Key: s3Key}});
  var imageStream = req.get(url)
      .on('response', function (response) {
        if (200 == response.statusCode) {
          //imageStream should be read()able by now right?
          s3.upload({Body: imageStream, ACL: "public-read", CacheControl: 5184000}, function (err, data) {  //2 months
            console.log(err,data);
          });
        }
      });
  });
  </code></pre>
  
  <p>Per the <a href="http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#upload-property" rel="noreferrer">aws-sdk docs</a> <code>Body</code> needs to be a <code>ReadableStream</code> object.</p>
  
  <p>What am I doing wrong here?</p>
  
  <p>This can be pulled off using the <a href="https://github.com/nathanpeck/s3-upload-stream" rel="noreferrer">s3-upload-stream</a> module, however I'd prefer to limit my dependencies.</p>