A tiny (~ 3Kb g-zipped) wrapper built around fetch with an intuitive syntax. Wretch is compatible with modern browsers out of the box. For older environments without fetch support, you should get a polyfill. Converts a javascript object to query parameters, then appends this query string to the current url. String values are used as the query string verbatim. Only compatible with browsers that support AbortControllers. Otherwise, you could use a (partial) polyfill. Associates a custom controller with the request. Useful when you need to use your own AbortController, otherwise wretch will create a new controller itself. Aborts the request after a fixed time. If you use a custom AbortController associated with the request, pass it as the second argument. Returns the automatically generated AbortController alongside the current wretch response as a pair.

Features

  • Because having to write a second callback to process a response body feels awkward
  • Configuration should not rhyme with repetition
  • Because manually checking and throwing every request error code is tedious
  • Because sending a json object should be easy
  • Wretch is compatible with modern browsers out of the box
  • For older environments without fetch support, you should get a polyfill

Project Samples

Project Activity

See All Activity >

Categories

AJAX

License

MIT License

Follow Wretch

Wretch Web Site

Other Useful Business Software
OpManager the network monitoring software used by over 1 million IT admins Icon
OpManager the network monitoring software used by over 1 million IT admins

Network performance monitoring, uncomplicated.

ManageEngine OpManager is a powerful network monitoring software that provides deep visibility into the performance of your routers, switches, firewalls, load balancers, wireless LAN controllers, servers, VMs, printers, and storage devices. It is an easy-to-use and affordable network monitoring solution that allows you to drill down to the root cause of an issue and eliminate it.
Learn More
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Wretch!

Additional Project Details

Programming Language

JavaScript

Related Categories

JavaScript AJAX Software

Registered

2022-02-23