got
16.2.0 · 30 Oct 2026MIT53.2M / weekRepositoryHomepagenpmAtom feed
7.1.0 is the newest release of 7.x.
In short
3 breaking9 new
- Breaking
Changes stringifying options behavior. 51a3eaf Setting the
bodyoption 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. - Breaking
Now also redirects on 307, 308, 303 responses. b45896a
- Breaking
The
timeoutoption now applies to the whole request and we added ability to control the timeout of the individual phases. 7964f2c
Security
1 advisory affects 7.0.0; 11.8.5 fixes them
- ModerateGot allows a redirect to a UNIX socketGHSA-pfrx-2q88-qq97 · 19 Jun 2022Fixed in 11.8.5
Release note
Breaking changes
- Breaking
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. - Breaking
Now also redirects on 307, 308, 303 responses. b45896a
- Breaking
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. c86706bNo longer throws HTTPError on 304 responses. 7b12b75
Added
protocolproperty to errors. 919703cAdded
urlproperty to errors. a287f8eIncludes response headers in errors, and redirect URLs in errors and the response. 8b4d06e
All changes
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.