title: How to use requests to send a PATCH request with headers
body: <p>I have a Rails 4 application which uses token based authentication for APIs and need to be able to update records through Python 3 script.</p>
  
  <p>My current script looks like this</p>
  
  <pre><code>import requests
  import json
  
  url = 'http://0.0.0.0:3000/api/v1/update_experiment.json'
  payload = {'expt_name' : 'A60E001', 'status' : 'done' }
  
  r = requests.patch(url, payload)
  </code></pre>
  
  <p>which works OK if I disable API authentication. </p>
  
  <p>I can't figure out how to add headers to it, <code>requests.patch</code> only takes two parameters according to docs. </p>
  
  <p>I would need to get to the point where the following header info would added</p>
  
  <pre><code>'Authorization:Token token="xxxxxxxxxxxxxxxxxxxxxx"'
  </code></pre>
  
  <p>This type of header works OK in curl. How can I do this in Python 3 and requests?</p>