title: Bearer Authentication in React
body: <p>How can I use Bearer Authentication with superagent in React?
  I am not sure in syntax and can't find an example.</p>
  <p>What I do now</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>   showTransactionList = () =&gt; {
          superagent
              .post('http://193.124.114.46:3001/api/protected/transactions')
              .set({'Authorization': 'Bearer ' + this.state.id_token})
              .accept('application/json')
              .then(res =&gt; {
                  const posts = JSON.stringify(res.body);
                  console.log(posts);
              })
              .catch((err) =&gt; {
                  console.log(err);
                  throw err;                    
              });
      }</code></pre>
  </div>
  </div>
  </p>
  <p>Thnx!</p>