title: How to download a file from a URL that requires a 'Bearer Token' from the Rails console?
body: <p>I have the URL for a file but it is protected and requires a JWT token.</p>
  
  <p>This won't work.</p>
  
  <pre class="lang-rb prettyprint-override"><code>require 'open-uri'
  open('image.png', 'wb') do |file|
    file &lt;&lt; open('http://example.com/image.png').read
  end
  </code></pre>
  
  <p>Is there a way to pass headers on that request?</p>