What is the purpose of creating an instance by axios? can you not use it?

axios.create ({baseURL: ajaxUrl,timeout: 3000dint withcredentials: true}) what is the role of creating an instance? sharp-sharp-sharp problem description
introduce axios, and then request axios.get ("url") .then (res= > {}) on the page. What role does the created instance play here

Jul.06,2021

the instance axios is exported by default, and you usually only need to use this axios .

but sometimes you need to create multiple instances, for example, you need to access multiple service addresses, and the structure of these service requests and responses are completely different, so you can create different instances by axios.create .

for example, axios1 uses http status codes to determine whether the response is normal, while axios2 is a status code defined by the server itself, or their request headers are different and support content-type , then I can write interceptors for axios1 and axios2 separately.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b2c1e5-4d18a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b2c1e5-4d18a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?