From b09ed059266acd604d3f4d7b019d82927a074372 Mon Sep 17 00:00:00 2001 From: Elridge D'Mello Date: Thu, 6 Jan 2022 14:58:20 -0600 Subject: [PATCH] docs fix: binary downloads as stream Empirically found that in 4.x (I used 4.6.1), the means to obtain a stream for a binary download is: `res.body` --- sdk/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/README.md b/sdk/README.md index 9f90ead4..c6ca630b 100644 --- a/sdk/README.md +++ b/sdk/README.md @@ -393,7 +393,7 @@ rcsdk.get('/restapi/v1.0/account/~/messages/foo/content').then(function(res) { // read as stream rcsdk.get('/restapi/v1.0/account/~/messages/foo/content').then(function(res) { - res.response().body.pipe(fs.createWriteStream('./octocat.png')); // we are accessing Node Fetch's Response + res.body.pipe(fs.createWriteStream('./octocat.png')); // we are accessing Node Fetch's Response }); ```