Releases: sindresorhus/got
Releases · sindresorhus/got
v8.0.1
v8.0.0
- Added a powerful
cacheoption. 3c79205 (Thanks to @lukechilds ✨) - Added download/upload progress events. be7b802 (Thanks to @vadimdemedes 🌟)
- Support for an object in the
agentoption. b9bf2e6 - [Breaking change] Uses HTTPS for protocol-less URLs (Previously it defaulted to
http). ae1a0fe - Excludes passed headers with values
nullorundefined. c5e2f8d - Fixed some memory leaks. 0c5e44c 98a7144
- [Potentially breaking change] Uses
statusMessagereturned by endpoint. 01c2636 - [Breaking change] Made the
useElectronoptionfalseby default. 33cbb6f - Exposed
got.CancelError. b55f79e - Fixed
.cancel()when timeout exists. e31282d
v7.1.0
- Added
decompressoption. f9d19e3 - Support
Arraywith thejsonoption. 1cf2bbf - Fixed a bug with the Unix address parser. c0c6bcf
- Worked around an issue with New Relic and Promise subclasses. sindresorhus/p-cancelable@fe1fb8e
7.0.0
Breaking changes
- Changes stringifying options behavior. 51a3eaf
Setting thebodyoption to be an object to stringify is no longer possible without setting either theformoption for URL encoding or thejsonoption for JSON encoding. Previously, Got would use URL encoding by default, now it will throw an error. Since thejsonoption also means Got will decode a JSON response for you, setting both options totruewill encode the request as URL and decode the response as JSON. - Now also redirects on 307, 308, 303 responses. b45896a
- The
timeoutoption now applies to the whole request and we added ability to control the timeout of the individual phases. 7964f2c
Highlights
- Added ability to cancel in-progress requests! 9ef7a5a
- Added WHATWG URL support. f501fc2
- Improve request retries by reducing the number of retries and making delays shorter. 14d0859
- Only throws
ParseErrorwhen parsing fails on 2xx responses. c86706b - No longer throws HTTPError on 304 responses. 7b12b75
- Added
protocolproperty to errors. 919703c - Added
urlproperty to errors. a287f8e - Includes response headers in errors, and redirect URLs in errors and the response. 8b4d06e
- Improve use in Electron. 2130570 6fc1902
All changes
6.7.0
This minor release fixes timeout behaviour to correspond with readme:
Milliseconds to wait for a server to send response headers before aborting request with ETIMEDOUT error.
Before this release ESOCKTIMEDOUT can be thrown (which can lead to false-positive errors for keep-alive sockets).
6.6.0
5.7.0 – Last minor release of 5.x branch
This is last release of 5.x branch (which compatible with old versions of Node.JS). In this release we pulled all fixes (only UTF in headers is not cherry-picked):
- Add
urlto response (#236) - Add
requestUrlto response in streaming mode (#230) - Allow non-plain object as request body (#217)
- Fixed unexpected EOF when decompressing content
- Detect formdata body and set content-type header (#220)
- Add a
requestUrlproperty to the response object (#205) - Add redirect url to response object (#191)
🎃 Happy Halloween!
6.5.0
- Add a redirect
urlproperty to the response object (#191) - Add a
requestUrlproperty to the response object (#205) - ⬆️
get-streambumped to^2.3.0– which fixes some nasty encoding bugs - Fix location encoding (#214)
- Detect formdata body and set content-type header (#220)
- ⬆️
unzip-responsebumped to^2.0.1– which fixesunexpected EOFerror - Allow non-plain object as request body (#217)
Changes
6.3.0
followRedirect option
This option disables following redirects and got will not treat them as errors:
const res = await got(`google.com`, {followRedirect: false});
res.statusCode === 302; // trueBy default this option is true, so no major changes in code are needed.