title: write a client in Python to call a rest web service using JWT authentication
body: <p>I have setup a Django REST endpoint with JSON Web Tokens (JWT) Authentication, following all the steps explained <a href="https://simpleisbetterthancomplex.com/tutorial/2018/12/19/how-to-use-jwt-authentication-with-django-rest-framework.html" rel="nofollow noreferrer">in this article</a>.</p>
  <p>Briefly, the exposed endpoints are:</p>
  <ul>
  <li>http://localhost:8000/api/token/  # to get a new jwt token</li>
  <li>http://localhost:8000/api/token/refresh/  # to refresh a jwt token</li>
  <li>http://localhost:8000/hello/  # a sample web service which requires
  jwt authentication</li>
  </ul>
  <p>The example explained in the article uses djangorestframework_simplejwt package, which uses settings.SECRET_KEY (of the Django web app) to encrypt the jwt tokens (using HS256 algorithm).</p>
  <p>Also, server side, I have created a specific username (&quot;testuser&quot;) with Django administration website to be used for JWT authorization.</p>
  <p><strong>Now, how can I start testing this REST web service which uses JWT authentication with a client written in Python?</strong></p>