| What it is | Promise based HTTP client for the browser and node.js | Human-friendly and powerful HTTP request library for Node.js | Ajax for Node.js and browsers (JS HTTP client) | Tiny & elegant JavaScript HTTP client based on the Fetch API |
| Features | - XMLHttpRequest and fetch in browsers, http module in Node.js
- Promise API with async/await
- request and response interceptors
- request and response data transforms
- cancellation with AbortController
- automatic JSON serialization and parsing
- multipart/form-data and URL-encoded serialization
- upload and download progress events
- All 14 features
| - promise API and stream API
- retries on failure, on by default
- advanced timeouts per request phase
- pagination API
- RFC 7234 compliant caching
- cookies
- HTTP/2 support
- proxy support and Unix domain sockets
- All 15 features
| - same chainable API in browsers and Node.js
- callbacks, promises and async/await
- JSON and URL-encoded bodies
- multipart attachments and fields
- retries for transient failures
- deadline and response timeouts
- Basic and Bearer auth
- agents that keep cookies
- All 14 features
| - built on the Fetch API, no dependencies
- method shortcuts (ky.get, ky.post, ky.put, ky.patch, ky.delete, ky.head, ky.query)
- HTTPError for non-2xx responses, configurable per status
- retries with backoff, Retry-After support and custom retry rules
- per-attempt timeout and an overall totalTimeout
- maximum response size
- upload and download progress callbacks
- baseUrl and prefix options, searchParams
- All 13 features
|
| Limitations | - HTTP/2 support is experimental: only the Node.js http adapter has it, and behaviour depends on the runtime and Node.js version
| - Doesn't run in the browser: it's an HTTP library for Node.js only
- Doesn't provide a CommonJS export: it's native ESM, so CommonJS projects must convert to ESM
| | - Doesn't run on Node.js versions before 22: it needs Node.js 22 or later and the latest Chrome, Firefox or Safari
|