current position:Home>Axios Foundation (4): Axios creates an instance object and sends a request

Axios Foundation (4): Axios creates an instance object and sends a request

2022-01-26 22:04:57 wb59770b05237ae


Sample code

       
// axios Create an instance object to initiate the request
const fun = axios.create({
baseURL: 'https://api.apiopen.top'
});
fun({
url: 'getJoke'
}).then(response => console.log(response));
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.



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

Random recommended