callarest
Advanced tools
Comparing version 1.3.1 to 1.4.0
@@ -30,7 +30,6 @@ const http = require('http'); | ||
const chunks = []; | ||
let chunks = Buffer.from([]); | ||
const request = httpOrHttps.request(opts, (response) => { | ||
response.setEncoding(options.encoding || 'utf8'); | ||
response.on('data', (chunk) => { | ||
chunks.push(chunk); | ||
chunks = Buffer.concat([chunks, chunk]); | ||
}); | ||
@@ -41,3 +40,3 @@ response.on('end', () => { | ||
response, | ||
body: chunks.join() | ||
body: chunks.toString(options.encoding || 'utf8') | ||
}); | ||
@@ -44,0 +43,0 @@ }); |
{ | ||
"name": "callarest", | ||
"version": "1.3.1", | ||
"version": "1.4.0", | ||
"keywords": [ | ||
@@ -5,0 +5,0 @@ "rest", |
11896
308