D
D
devilsD2018-12-13 13:52:50
JavaScript
devilsD, 2018-12-13 13:52:50

Axios How to add a GET parameter to every request?

Axios How to add a GET parameter to every request?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Anton Spirin, 2018-12-13
@devilsD

axios.defaults.params = {
  'param': paramValue,
};

M
Mikhail Korobkov, 2018-12-13
@mkorobkov

axios.defaults

E
enchikiben, 2018-12-13
@EnChikiben

right in the dock it says: https://github.com/axios/axios

// 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
  });

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question