title: Using Axios GET with Authorization Header in React-Native App
body: <p>I'm trying to use axios for a GET request with an API which requires an <code>Authorization</code> header.</p>
  
  <p>My current code:</p>
  
  <pre class="lang-js prettyprint-override"><code>const AuthStr = 'Bearer ' + USER_TOKEN;
  </code></pre>
  
  <p>where <code>USER_TOKEN</code> is the access token needed. This string concatenation may be the issue as if I post this as <code>AuthStr = 'Bearer 41839y750138-391'</code>, the following GET request works and returns the data I'm after.</p>
  
  <pre class="lang-js prettyprint-override"><code>axios.get(URL, { 'headers': { 'Authorization': AuthStr } })
    .then((response =&gt; {
      console.log(response.data);
    })
    .catch((error) =&gt; {
      console.log(error);
    });
  </code></pre>
  
  <p>I also tried setting this as a global header with no success.</p>