🌳 Tiny & elegant JavaScript HTTP client based on the browser Fetch API
MIT License
Bot releases are hidden (Show)
ky.extend()
(#235) 70826b2https://github.com/sindresorhus/ky/compare/v0.19.1...v0.20.0
Content-Type
header for multipart requests (#211) d547e89https://github.com/sindresorhus/ky/compare/v0.18.0...v0.19.0
response
to beforeRetry
hook and change its parameter to be a single object (#201) 3f3e14d
-(request, options, error, retryCount) => {
+({request, response, options, error, retryCount}) => {
https://github.com/sindresorhus/ky/compare/v0.17.0...v0.18.0
HTTPError
and TimeoutError
are now properties on the default export ky
instead of individual named exports..default
property: const ky = require('ky/umd').default;
→ const ky = require('ky/umd');
https://github.com/sindresorhus/ky/compare/v0.16.2...v0.17.0
json
option (#223) b20779bhttps://github.com/sindresorhus/ky/compare/v0.16.1...v0.16.2
content-type
header check for FormData body (#208) 2078a15https://github.com/sindresorhus/ky/compare/v0.16.0...v0.16.1
Request
instance as the first argument instead of the input URL, which could previously either be a string
, Request
, or URL
(#180) c5821a7beforeRetry
hooks (#198) 0bc6fb1beforeRequest
hooks can now return a Request
instance to replace the existing request (https://github.com/sindresorhus/ky/pull/180)prefixUrl
reasonings (#175) 4e05289https://github.com/sindresorhus/ky/compare/v0.15.0...v0.16.0
BeforeRequestHook
TypeScript type (#181) 32a7007input
argument (#176) 68959c4https://github.com/sindresorhus/ky/compare/v0.14.0...v0.15.0
beforeRetry
hook (#159) 4eb3677Response
from a beforeRequest
hook (#172) 59d36achttps://github.com/sindresorhus/ky/compare/v0.13.0...v0.14.0
input
& options
arguments to beforeRequest
& afterResponse
hooks (#163) 9181aa2 await ky('…', {
hooks: {
beforeRequest: [
- options => {}
+ (input, options) => {}
]
afterResponse: [
- response => {}
+ (input, options, response) => {}
]
}
});
retry
option more powerful (#110) d4ddb7aOptions
TypeScript type (#165) bfdc9b5https://github.com/sindresorhus/ky/compare/v0.12.0...v0.13.0
Request
instance as input (#147) 9c81d89BeforeRequestHook
TypeScript type (#161) 0a0427dhttps://github.com/sindresorhus/ky/compare/v0.11.2...v0.12.0
https://github.com/sindresorhus/ky/compare/v0.11.1...v0.11.2
https://github.com/sindresorhus/ky/compare/v0.11.0...v0.11.1
Breaking (possibly):
Enhancements:
onDownloadProgress
option (#34) f89d796Fixes:
ky.extend()
not inheriting its parent and add ky.create()
(#128) 0a6beb1https://github.com/sindresorhus/ky/compare/v0.10.0...v0.11.0
Breaking (for TypeScript users only):
Ky
TypeScript namespace 7114ba3Enhancements:
ky-universal
) fcffa18Fixes:
AbortController
, for example, React Native (#125) a012fd3afterResponse
hook & retry not being called (#95) cd33a63.json()
method generic (#98) ce12902ky/umd
TypeScript definition (#89) 5fabe0c