title: Python requests, keep getting 401 error when accessing an API
body: <p>I am trying to make a connection to this <a href="https://gimbal.com/doc/rest.html" rel="nofollow">API</a> with requests.
  Specifically I was trying to access the "all applications" endpoint, yet I am having trouble making an initial connection.</p>
  
  <pre><code>&gt;&gt;&gt; import requests
  &gt;&gt;&gt; 
  &gt;&gt;&gt; url = "https://manager.gimbal.com/api/applications"
  &gt;&gt;&gt; headers = {
  ... 'Authorization': 'Token &lt;MyApiKeyIsHere&gt;',
  ... 'content-type': 'application/json'
  ... }
  &gt;&gt;&gt; 
  &gt;&gt;&gt; 
  &gt;&gt;&gt; 
  &gt;&gt;&gt; r = requests.get(url, headers=headers)
  &gt;&gt;&gt; r
  &lt;Response [401]&gt;
  </code></pre>
  
  <p>I am a bit confused as to why I am not getting an unauthorized connection to the API. If anyone can offer some pointers, that would be extremely helpful.</p>