current position:Home>Axios Foundation (III): common basic configurations of Axios

Axios Foundation (III): common basic configurations of Axios

2022-01-26 22:04:56 wb59770b05237ae


Common basic configuration

       
// axios Common default configurations for
axios.defaults.method = 'GET';
axios.defaults.baseURL = 'http://localhost:3000';
axios.defaults.params = {id: 2};
btns[0].onclick = function() {
axios({
url: '/posts'
}).then(response => {console.log(response);})
}
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.

axios Basics ( 3、 ... and ):axios Common basic configuration of _ios



copyright notice
author[wb59770b05237ae],Please bring the original link to reprint, thank you.
https://en.cdmana.com/2022/01/202201262204543750.html

Random recommended