axios get req with basic auth

Solutions on MaxInterview for axios get req with basic auth by the best coders in the world

showing results for - "axios get req with basic auth"
Benjamin
23 Nov 2017
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