Ky targets modern browsers and Deno. For older browsers, you will need to transpile and use a fetch polyfill and globalThis polyfill. For Node.js, check out Got. For isomorphic needs (like SSR), check out ky-universal. It's just a tiny file with no dependencies. Internally, the standard methods (GET, POST, PUT, PATCH, HEAD and DELETE) are uppercased in order to avoid server errors due to case sensitivity. Search parameters to include in the request URL. Setting this will override all existing search parameters in the input URL. After prefixUrl and input are joined, the result is resolved against the base URL of the page (if any). The hook can return a Request to replace the outgoing request, or return a Response to completely avoid making an HTTP request. This can be used to mock a request, check an internal cache, etc. An important consideration when returning a request or response from this hook is that any remaining beforeRequest hooks will be skipped.

Features

  • Simpler API
  • Method shortcuts (ky.post())
  • Treats non-2xx status codes as errors (after redirects)
  • Retries failed requests
  • Timeout support
  • Instances with custom defaults

Project Samples

Project Activity

See All Activity >

License

MIT License

Follow ky

ky Web Site

Other Useful Business Software
Gen AI apps are built with MongoDB Atlas Icon
Gen AI apps are built with MongoDB Atlas

Build gen AI apps with an all-in-one modern database: MongoDB Atlas

MongoDB Atlas provides built-in vector search and a flexible document model so developers can build, scale, and run gen AI apps without stitching together multiple databases. From LLM integration to semantic search, Atlas simplifies your AI architecture—and it’s free to get started.
Start Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of ky!

Additional Project Details

Programming Language

TypeScript

Related Categories

TypeScript HTTP Servers, TypeScript HTTP Clients

Registered

2021-08-16