1const res = await axios.get('https://httpbin.org/basic-auth/foo/bar', {
2 // Axios looks for the `auth` option, and, if it is set, formats a
3 // basic auth header for you automatically.
4 auth: {
5 username: 'foo',
6 password: 'bar'
7 }
8});
9res.status; // 200