title: Add `Authorization Bearer` hash to Net::HTTP post request (Ruby)
body: <p>How can I add <code>Authorization Bearer</code> to a POST request with <code>Net::HTTP</code>?</p>
  
  <p>I can only find help for "basic authentication" in the documentation.</p>
  
  <pre><code>req.basic_auth 'user', 'pass'
  </code></pre>
  
  <p>Source: <a href="https://docs.ruby-lang.org/en/2.0.0/Net/HTTP.html#class-Net::HTTP-label-Basic+Authentication" rel="noreferrer">https://docs.ruby-lang.org/en/2.0.0/Net/HTTP.html#class-Net::HTTP-label-Basic+Authentication</a></p>
  
  <p>I'm trying to replicate a curl that would look like:</p>
  
  <pre><code>&gt; curl 'http://localhost:8080/places' -d '{"_json":[{"uuid":"0514b...",
  &gt; "name":"Athens"}]}' -X POST -H 'Content-Type: application/json' -H
  &gt; 'Authorization: Bearer eyJ0eXAiO...'
  </code></pre>
  
  <p>Currently I've gotten to:</p>
  
  <pre><code>require 'net/http'
  require 'net/https'
  require 'uri'
  
  uri = URI('http://localhost:8080/places')
  
  res = Net::HTTP.post_form(uri, '_json' =&gt; [{'uuid': '0514b...', 'name':'Athens'}])
  </code></pre>
  
  <p>But I'm having trouble figuring out how to add the <code>Authentication: Bearer...</code> part.</p>
  
  <p>Does anyone have experience with this?</p>