Get started with superagent CDN

MIT licensed

Superagent is a popular library for making asynchronous HTTP requests.

Tags:
  • http
  • ajax
  • request
  • agent

Stable version

Copied!

How to start using superagent CDN


const Superagent = require('superagent'); // Assuming you have Superagent installed via npm

// If you're using the CDN version, remove this line
// const Superagent = require('superagent');

// Use the CDN version instead
const Superagent$ = window.Superagent || require('superagent');

Superagent$
  .get('https://jsonplaceholder.typicode.com/todos/1')
  .then(res => {
    console.log(res.body);
  })
  .catch(err => {
    console.error(err);
  });
Copied!
Copied!

All versions