title: Base64 Authentication Python
body: <p>I'm following an api and I need to use a Base64 authentication of my User Id and password.</p>
  
  <p>'User ID and Password need to both be concatenated and then Base64 encoded'</p>
  
  <p>it then shows the example</p>
  
  <pre><code>'userid:password'
  </code></pre>
  
  <p>It then proceeds to say 'Provide the encoded value in an "Authorization Header"'</p>
  
  <p>'for example: <strong>Authorization: BASIC {Base64-encoded value}</strong>'</p>
  
  <p>How do I write this into a python api request?</p>
  
  <pre><code>z = requests.post(url, data=zdata )
  </code></pre>
  
  <p>Thanks</p>