mikeal/request — pull request #1185 by simov (2014-10-18 12:51:38+00:00)
Title: Stream multipart/related bodies

:wave:

Related to this one https://github.com/mikeal/request/issues/1181

My test case

```js
request.post('https://www.googleapis.com/upload/drive/v2/files', {
qs:{
access_token:'...',
uploadType:'multipart'
},
multipart: [
{
'Content-Type':'application/json',
body: JSON.stringify({
title:'cat.png'
})
},
{
'Content-Type':'image/png',
body: fs.createReadStream('cat.png')
}
]
},
function (err, res, body) {});
```

Basically I'm using the same module that _form-data_ uses internally - https://github.com/felixge/node-combined-stream

Google [implements](https://github.com/google/google-api-nodejs-client/blob/master/lib/apirequest.js#L142-L181) their `multipart/related` support in much the same way, using [multipart-stream](https://github.com/hendrikcech/multipart-stream) which in turn uses [sandwich-stream](https://github.com/connrs/node-sandwich-stream)