Browse Source

improve promise usage example

http2
Vsevolod Strukchinsky 10 years ago
parent
commit
e2b4580809
  1. 5
      readme.md

5
readme.md

@ -40,7 +40,10 @@ got('todomvc.com')
.then(function (res) { .then(function (res) {
console.log(res.body); console.log(res.body);
}) })
.catch(console.error); .catch(function (err) {
console.error(err);
console.error(err.response && err.response.body);
});
// Stream mode // Stream mode
got.stream('todomvc.com').pipe(fs.createWriteStream('index.html')); got.stream('todomvc.com').pipe(fs.createWriteStream('index.html'));

Loading…
Cancel
Save