title: Why axios GET call not working for basic authentication?
body: <p>I have some users data at <a href="http://localhost:8085/api/v1/users" rel="nofollow noreferrer">http://localhost:8085/api/v1/users</a>, which is secured with basic auth. If I access this URL from browser(the URL box), it sends a <code>GET</code> request and the login(auth) prompt comes up. After filling the correct details, browser shows me the data. Even the client app like POSTMAN are working fine.</p>
  
  <p>But this is not happening with the axios call. Below is the <code>GET</code> call:</p>
  
  <pre><code>axios
      .get(
        "http://localhost:8085/api/v1/users",
        {},
        {
          auth: {
            username: "sample@gmail.com",
            password: "pass@"
          }
        }
      )
      .then(resp =&gt; console.log(resp))
      .catch(err =&gt; console.log(err));
  </code></pre>
  
  <p>I even tried below:</p>
  
  <pre><code>axios({
        method: "get",
        baseURL: endpoint,
        auth: {
              username: "sample@gmail.com",
              password: "pass@"
             }
        })
        .then(resp =&gt; console.log(resp))
        .catch(err =&gt; console.log(err));
  </code></pre>
  
  <p>I think the axios is not adding Basic auth headers to the request.
  What wrong am I doing here? Suggestions please.</p>