0 points

Axios Cheat Sheet - Kapeli


dashboard

Mon Oct 26 2020 19:39:13 GMT+0000 (UTC)

Posted by @devandapaige #react.js ##axios ##react

// Make a request for a user with a given ID
axios.get('/user?ID=12345')
  .then(function (response) {
    console.log(response);
  })
  .catch(function (error) {
    console.log(error);
  });

// Optionally the request above could also be done as
axios.get('/user', {
    params: {
      ID: 12345
    }
  })
  .then(function (response) {
    console.log(response);
  })
  .catch(function (error) {
    console.log(error);
  });
content_copy Copy

GET request

https://kapeli.com/cheat_sheets/Axios.docset/Contents/Resources/Documents/index