unstale

npm / got

got

What changed in got 15 to 16, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-19.

22 breaking6 new APIs and options9 behavior and defaults31 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli 0.2.0 on npm

got 1667 changes

Breaking changes 22

  • Default body, json, and form payloads are no longer sent with every request; payloads are never merged with defaults.

    16.1.0release notes

  • A handlers entry that is not a function now throws an error.

    16.1.0release notes

  • A HEAD request remains HEAD after a 301, 302, or 303 redirect instead of becoming GET.

    16.1.0release notes

  • Negative or fractional values now throw an error.

    16.1.0release notes

  • An empty method now throws an error instead of being accepted.

    16.1.0release notes

  • A prefix URL containing a query string or fragment now throws an error.

    16.1.0release notes

  • The promise response event now fires only for the final response, not for each retry attempt.

    16.1.0release notes

  • Response bodies no longer retain a leading UTF-8 byte order mark.

    16.1.0release notes

  • Negative or fractional retry limits now throw an error.

    16.1.0release notes

  • Hop-by-hop headers are no longer copied to a piped ServerResponse.

    16.1.0release notes

  • agent.http2 is now an opt-out flag; set it to false to skip session pooling. Passing an agent instance throws.

    16.0.0release notes

  • The deprecated auth option stub was removed; passing it now throws Unexpected option.

    16.0.0release notes

  • Piped headers no longer copy credentials, including authorization, cookie, cookie2, set-cookie, and set-cookie2; pass credentials explicitly when the upstream is trusted.

    16.0.0release notes

  • When a hook, retry, or pagination step changes origin, Got strips credentials and clears an unchanged body; set headers or body explicitly to retain them.

    16.0.0release notes

  • The deprecated followRedirects option stub was removed; passing it now throws Unexpected option.

    16.0.0release notes

  • HTTP/2 proxy support is no longer provided by Got; the notes say to keep using http2-wrapper through the request option if needed.

    16.0.0release notes

  • Got now has a built-in HTTP/2 client with session pooling and multiplexing, and no longer relies on http2-wrapper.

    16.0.0release notes

  • The OptionsOfUnknownResponseBody type was removed; it was an alias for StrictOptions.

    16.0.0release notes

  • Use response.statusCode for the status because HTTP/2 response headers no longer contain pseudo-headers.

    16.0.0release notes

  • A server response with Retry-After: 0 now retries immediately instead of using the backoff delay.

    16.0.0release notes

  • The deprecated searchParameters option stub was removed; passing it now throws Unexpected option.

    16.0.0release notes

  • timeout.socket now applies during HTTP/2 TLS negotiation and session setup, reports a socket timeout, and no longer counts DNS lookup time.

    16.0.0release notes

New APIs and options 5

  • The DnsCacheLookup type is now exported.

    16.1.0release notes

  • The DnsCacheOptions type is now exported.

    16.1.0release notes

  • The Timings type is now exported.

    16.1.0release notes

  • Adds got.query() for the QUERY method, which is safe and idempotent, retried by default, and keeps replayable bodies across redirects; the built-in cache does not store QUERY responses.

    16.0.0release notes

  • Adds got.stream.query() for the QUERY method, which is safe and idempotent, retried by default, and keeps replayable bodies across redirects; the built-in cache does not store QUERY responses.

    16.0.0release notes

Behavior and default changes 9

  • The followRedirect option is evaluated once per response.

    16.1.0release notes

  • Headers now accept number values.

    16.1.0release notes

  • Extending an instance now inherits the parent's mutableDefaults setting, like got.extend(instance).

    16.1.0release notes

  • Stacked content codings are now supported.

    16.1.0release notes

  • The x-gzip content coding is now supported.

    16.1.0release notes

  • With http2: true, a custom HTTPS agent makes Got use the native HTTP/1.1 path because the built-in session pool does not support custom HTTPS agents.

    16.0.0release notes

  • dnsCache: true uses Got's built-in cache; the option also accepts objects with lookup and optional clear functions. The cache resolves A and AAAA records separately and cannot preserve OS-specific verbatim ordering.

    16.0.0release notes

  • URL credentials are preserved when prefixUrl changes to a same-origin value, and credentials in prefixUrl are treated as explicit.

    16.0.0release notes

  • If options.request returns a request or response, it controls the transport and bypasses Got's HTTP/2 client; return undefined to use Got's transport.

    16.0.0release notes

Fixes and other changes 31

  • Hook edge cases are fixed.

    16.1.0release notes

  • Hook edge cases are fixed.

    16.1.0release notes

  • Hook edge cases are fixed.

    16.1.0release notes

  • Streams configured with a body, json, or form option now reject writes, matching documented behavior.

    16.1.0release notes

  • Content-Length remains correct when a hook replaces the body during a redirect.

    16.1.0release notes

  • Cookie edge cases with retries, redirects, and async cookie jars are fixed.

    16.1.0release notes

  • Upload handling now respects DataView byte ranges.

    16.1.0release notes

  • Diagnostics channel coverage now includes retries and terminal errors.

    16.1.0release notes

  • Custom DNS cache lookups and DNS records without a valid TTL are fixed.

    16.1.0release notes

  • FormData request bodies are retried by re-serializing them instead of failing.

    16.1.0release notes

  • HTTP/2 edge cases are fixed, including requests that could hang forever when a response or request was destroyed.

    16.1.0release notes

  • Infinity timeouts no longer fire immediately or throw.

    16.1.0release notes

  • JSON containing a byte order mark now parses.

    16.1.0release notes

  • Default pagination now handles real-world Link headers, with pagination option and limit edge cases also fixed.

    16.1.0release notes

  • Redirects now keep the URL fragment.

    16.1.0release notes

  • Retries with replaced or non-replayable bodies are fixed.

    16.1.0release notes

  • Error stacks now report the real error class instead of RequestError; other error cause edge cases are fixed.

    16.1.0release notes

  • Response body decoding and parsing edge cases are fixed.

    16.1.0release notes

  • Retry delay edge cases are fixed, including invalid Retry-After values and calculateDelay for afterResponse retries.

    16.1.0release notes

  • Stream handling now respects backpressure.

    16.1.0release notes

  • The request timeout no longer restarts on each redirect; timeout phase edge cases are also fixed.

    16.1.0release notes

  • TypeScript types now match runtime values.

    16.1.0release notes

  • Streams stop forwarding after unpipe.

    16.1.0release notes

  • Upload progress total is fixed for Content-Length: 0.

    16.1.0release notes

  • Web ReadableStream request bodies can now be cancelled correctly.

    16.1.0release notes

  • allowGetBody now works over HTTP/2.

    16.0.0release notes

  • Got waits for asynchronous cookie jar writes on terminal redirect responses, including when followRedirect is false.

    16.0.0release notes

  • When a cookie jar write throws, error.response.body is complete, decompressed, and decoded with the configured encoding; decoding failures no longer mask the original error.

    16.0.0release notes

  • got.stream no longer finalizes the response before the response event or before piped server response headers are set.

    16.0.0release notes

  • Connection errors reported by request.end() are retried instead of failing the request.

    16.0.0release notes

  • strictContentLength no longer counts bytes from responses that were not actually decompressed.

    16.0.0release notes

got 151 changes

New APIs and options 1