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.
    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.
    - { retries: 4 }{ retry: 4 }
    - { retries: () => { … } }{ retry: { retries: () => { … } } }
  • Renamed the .canceled property to .isCanceled.
  • Dropped support for the body option being an Array when form: true.
    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).


Bug fixes



Welcome @szmarczak and @brandon93s as maintainers 🎉

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

All changes

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