Get started with wretch CDN

MIT licensed

The Wretch library is a lightweight, modular solution for making asynchronous HTTP requests.

Tags:
  • wretch
  • fetch
  • ajax
  • request

Stable version

Copied!

How to start using wretch CDN


const Wretch = require('wretch');

// Create a new instance of Wretch
const wretch = new Wretch();

// Define the URL to fetch
const url = 'https://jsonplaceholder.typicode.com/todos/1';

// Make the GET request and handle the response
wretch(url)
  .get()
  .map(response => response.json())
  .tap(data => console.log(data))
  .catch(error => console.error(error))
  .end();
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!

All versions