github sindresorhus/got v9.0.0

Got version 9 is a massive release! Many new awesome features and we have pretty much fixed all the open issues regarding Got bugs on the issue tracker.

Got is a human-friendly and powerful HTTP request library for Node.js

Breaking changes

  • Requires Node.js 8.
    You might ask, why not follow the Node.js LTS cycle and target Node.js 6. In short, async/await and WHATWG URL, which enabled us to simplify the codebase and reduce the dependency-tree considerably. Got v8 is a stable release, and you can continue using that if you need to support Node.js 6.
  • The retry functionality was rewritten to improve its reliability and to support retrying on HTTP status codes. Previously, it only retried on some network failures. https://github.com/sindresorhus/got/commit/98b566444c9dd103af14281ace61fe2bd17d4f49
    The option was renamed from retries to retry and it now accepts either a number of retries or an object with the ability to specify the number of retries, HTTP status codes and methods to retry on, and a function to decide how to retry. See the docs for more.
    Migration:
    - { retries: 4 }{ retry: 4 }
    - { retries: () => { … } }{ retry: { retries: () => { … } } }
  • Renamed the .canceled property to .isCanceled. https://github.com/sindresorhus/got/commit/00fdeea9395225f1ca0f25230f5dfcc4010e3af0
  • Dropped support for the body option being an Array when form: true. https://github.com/sindresorhus/got/commit/dfe5b1cfd762d4ccf4bf53ef2c1c0b31500baa30
    The built-in new URLSearchParams() API doesn't support this either and it's a weird use-case. If you need support for this, just don't set form: true and handle stringifying yourself.
  • Got throws an error if .pipe() was called after the response has been emitted.
    This makes us sure you receive whole response in case flowing mode is on (#223).

Improvements

Bug fixes

Other

Team

Welcome @szmarczak and @brandon93s as maintainers 🎉

Special shoutout to @jstewmon for helping us with many of the above improvements and fixes 🙌

All changes

https://github.com/sindresorhus/got/compare/v8.3.2...v9.0.0

latest releases: v11.7.0, v11.6.2, v11.6.1...
2 years ago