While this is an beta release, the code is well-tested and fairly stable. We encourage you to test it out and report any issues.
$ npm install got@10.0.0-beta.1
Make sure you also read the alpha.1
, alpha.2
, and alpha.3
release notes.
Changes in beta 1:
Breaking
- Remove the
query
option in favor of thesearchParams
option (It was previously deprecated) 518f0f5 - Rename the
stream
option toisStream
518f0f5 - Don't include the Got version in the default
user-agent
header (#911) 95bed1egot/9.6.0 (https://github.com/sindresorhus/got)
→got (https://github.com/sindresorhus/got)
- Why: Importing package.json to get the version caused a lot of problems.
- Remove
got.create()
518f0f5- You can achieve the same thing with
got.extend()
now.
- You can achieve the same thing with
- Remove
got.mergeInstances()
518f0f5- Use
gotInstance.extend(...gotInstances)
instead.
- Use
- Use
undefined
instead ofnull
to omit a header (https://github.com/sindresorhus/got#headers) 518f0f5
Enhancements
- Add
maxRedirects
option (#914) 0c505b0 - Add ability to use something other than
tough-cookie
for handling cookies (#882) 518f0f5 - Allow method rewriting on redirects (#913) b7ead5f
options.timeout
can now be modified in hooks d520a3aoptions.prefixUrl
can now be modified in hooks (#867) 518f0f5- Only allow supported event names when using TypeScript (#877) 518f0f5
Fixes
- Fix Node.js 13 compatibility (#915) b0dfc95
- Fix memory leak when using cache feature (#792) 518f0f5
- Don't throw on
204 No Content
when parsing response (#925) 518f0f5 - When redirect fails, don't retry from scratch (#930) 518f0f5
- Retrying inside
afterResponse
hook should triggerbeforeRetry
hook (#918) 518f0f5 - Fix a bug that sometimes caused the Node process to hang 518f0f5
- Fix a bug where cookies weren't reset on redirect between two different sites 518f0f5