in

Create an instance

You can create a new AXIOS instance using a custom configuration

axios.create([config])

let instance = axios.create({
    baseURL: 'http://xxx',
    timeout: 1000,
    headers: {'X-Custom-Header': 'foobar'}});Copy the code

Request configuration

These are the configuration options you can use when creating a request. Only urls are required. If method is not specified, the request uses the get method by default.


Copy the code

Cooperate with qs library

General packaging reference:

Encapsulation of AXIos in VUE

Encapsulate AXIos for use as a VUE plug-in