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
MongoDB Atlas runs apps anywhere Icon
MongoDB Atlas runs apps anywhere

Deploy in 115+ regions with the modern database for every enterprise.

MongoDB Atlas gives you the freedom to build and run modern applications anywhere—across AWS, Azure, and Google Cloud. With global availability in over 115 regions, Atlas lets you deploy close to your users, meet compliance needs, and scale with confidence across any geography.
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