Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The documentation for the Axios Get Example shows the .then() method instead of the .finally() method #4940

Closed
sushantawalekar opened this issue Sep 3, 2022 · 1 comment

Comments

@sushantawalekar
Copy link

sushantawalekar commented Sep 3, 2022

Section/Content To Improve

Quote or link to section

https://axios-http.com/docs/example

const axios = require('axios').default;

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

// 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);
  })
  .then(function () {
    // always executed
  });  

Suggested Improvement

Identify what is confusing or incorrect and what could make it better
In accordance with correct syntax, get example should have .finally instead of .then

@jasonsaayman
Copy link
Member

Fixed in #4942

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants