v11.0.0-beta.1
Pre-release
Pre-release
$ npm install [email protected]
The release notes will be improved in the final v11 release.
Changes in beta 1:
Breaking
API
options.encoding
will no longer affect streams (reverting back to the Got 9 behavior), usegot.stream(…).setEncoding(encoding)
instead (to prevent confusion).- Renamed
GotError
toRequestError
. options.agent
can no longer be an instance ofhttp.Agent
. Instead you need to pass:
{
http: new http.Agent(…),
https: new https.Agent(…),
http2: new http2wrapper.Agent(…)
}
- The deprecated
useElectronNet
option has been removed. dnsCache
is now enabled by default.dnsCache
no longer can be a Map or a Keyv instance, instead you need to pass a CacheableLookup instance.- Errors thrown in
init
hooks will be converted toRequestError
s (why:RequestError
provides much more useful information (e.g. Got options) than the usual TypeError etc.). options._pagination
has been renamed tooptions.pagination
.- The
options.url
property will no longer be visible ininit
hooks (design limitation). - The
error.request
property is no longer aClientRequest
instance. Instead, it gives a Got stream.
Types
- The
ResponseObject
type has been merged into theResponse
type. - Renamed the
Defaults
type toInstanceDefaults
. - Renamed the
DefaultOptions
type toDefaults
. - Renamed the
DefaultRetryOptions
type toRequiredRetryOptions
. - Renamed the
GotOptions
type toOptions
. - Renamed the
GotRequestMethod
type toGotRequestFunction
.
Enhancements
- Fixes #1016
- Fixes #981
- Fixes #932
- Fixes #929
- Fixes #1058
- Fixes #167
- Fixes #1138
- Fixes #1113
- Fixes #1129
- Errors now have a
request
property (it's a Got stream).
Known bugs
- The
timings
indicate that the request was successful (even though it errored). - The
downloadProgress
object may show incorrect data if the request has errored.