title: How to use jwt authorization with python's library requests?
body: <p>I'm developing a Flask RESTFULL API with flask_jwt_extended library as extension for authorization.</p>
  <p>Now, I have two usuals resources for register an user and for login, that works perfectly. With login resource an user can give their email and password and get back a token. From Postman this token works as expected using Bearer Token mode.</p>
  <p>However, I need to make some requests directly from Python3 terminal. Until now, I was using a simple name-password authentication in my requests, so an example of a request would be:</p>
  <pre><code>import requests as rs
  
  rs.get('http://localhost:5000/api/samples', auth = ('user', 'pass'))
  </code></pre>
  <p>Now, using jwt tokens, I'm trying the following:</p>
  <pre><code>import requests as rs
  
  # xxxxxx is a really long string got previously with login resource
  
  rs.get('http://localhost:5000/api/samples', auth = (&quot;xxxxxx&quot;))
  
  </code></pre>
  <p>but this approach give to me:</p>
  <pre><code>TypeError: 'str' object is not callable
  </code></pre>
  <p>In other posts I've checked that this type of authorization is made through headers, so I've also tried:</p>
  <pre><code>import requests as rs
  
  # xxxxxx is a really long string got previously with login resource
  
  rs.get('http://localhost:5000/api/samples', headers = {'Authorization': 'access_token xxxxxx'})
  
  </code></pre>
  <p>and the error here is an instantly 401 http response.</p>
  <p>Hope someone could help me!</p>
  <p>Thanks you in advance!</p>