Complete the code to import Axios in a Vue component.
import [1] from 'axios';
The correct import name for Axios is axios with a lowercase 'a'.
Complete the code to create an Axios instance with a base URL.
const api = axios.[1]({ baseURL: 'https://api.example.com' });
The method to create a new Axios instance is create.
Fix the error in setting a default header for the Axios instance.
api.defaults.headers.common['[1]'] = 'Bearer token123';
The correct header name for bearer tokens is Authorization with uppercase 'A'.
Fill both blanks to add a request interceptor that logs the request URL.
api.interceptors.[1].use(config => { console.log(config.[2]); return config; });
To intercept requests, use request interceptor and log the url property from the config.
Fill all three blanks to create a GET request with Axios and handle the response.
api.[1]('/users') .then(response => { console.log(response.[2]); }) .catch(error => { console.error(error.[3]); });
Use get to make a GET request, access data from the response, and message from the error.
