Releases: sindresorhus/got
Releases · sindresorhus/got
v9.3.0
v9.2.2
v9.2.1
v9.2.0
- Experimental HTTP2 support. (#583) 8191daf
- Add
cookieJar
option. (#596) eedebc9 - Provide timings. (#590) 78a56ec
- Set
content-length
header to zero when doing a PUT request with no body. (#584) 9a966ec - Don't parse the
query
option when it's a string. (#589) f23f350 - Document the
response
object. (#592) 267cb66 - Fix Electron throwing
HTTP trailers are not supported
error. (#598) e66a6b6
v9.1.0
- Add
got.mergeInstances()
which lets you easily compose multiple instances of Got into a single one. It's like plugins without any of the plugin mess. (#510) f0b190a - Normalize the URL in the
baseUrl
option. (#579) c901c46 - Follow redirects with encoded URI. (#564) 3d98b9b
- Allow the
query
option to be aURLSearchParams
instance. (#565) b8a086f - Support retrying on 500 HTTP status code. a3e77de
- Bump
get-stream
to 0.4.0 for improved handling of stream edge-cases. (#578) 45d3a60 - Normalize the casing of the
method
option. (#547) ecf3180 - Fix the
agent
option withgot.extend()
. (#577) 2ffcd49 - Fix throwing errors when using
got.stream()
. (#550) ae5b114 - Ignore empty query objects. (#572) eb652f8
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. 98b5664
The option was renamed fromretries
toretry
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
. 00fdeea - Dropped support for the
body
option being an Array whenform: true
. dfe5b1c
The built-innew URLSearchParams()
API doesn't support this either and it's a weird use-case. If you need support for this, just don't setform: 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
- Fewer dependencies and smaller install size!
- Got v9:
- Got v8:
- Request (latest):
- The
timeout
option was rewritten to be more reliable and flexible. You can now set a timeout for every phase of the request if you want, or just for the whole request. That's up to you. da4f236 - Added
got.extend()
which lets you easily create instances of Got with some options overridden. bc41a49 - Added
got.create()
which is a more advanced and powerful version ofgot.extend()
. With this API, you can create your own niche-specific instance of Got, for example, an HTTP-client for GitHub. bc41a49 - Added a
beforeRequest
hook. 107756f - Added
request
andresponse
events to the Promise API. e86aad7 - The
content-length
header is now also automatically set if thebody
option is set to afs.createReadStream
instance. 6e7a455 - You can now remove the default
user-agent
header by passing in'user-agent': null
as a header. e473a26 - The
body
option can now be any kind of object, not just a plain object. 7a49ce7
Bug fixes
- Fixed a problem with the cache not working when using the
query
option. 07a91cc - Less unhandled errors (Hopefully none!). f621184
- Headers are now correctly proxied when you pipe
got.stream()
. 83bc44c - Lots of more bug fixes.
Other
- 100% code coverage! Doing this caught a couple of bugs, so definitely worth doing even if 100% doesn't mean bug-free.
- The codebase was significantly refactored for better readability and maintainability. b54b680
Team
Welcome @szmarczak and @brandon93s as maintainers 🎉
Special shoutout to @jstewmon for helping us with many of the above improvements and fixes 🙌
All changes
v8.3.2
v8.3.1
v8.3.0
v8.2.0
No longer sets the default accept-encoding: gzip,deflate
header if the decompress
option is false
.