title: python requests POST with header and parameters
body: <p>I have a post request which I am trying to send using <code>requests</code> in python. But I get an invalid 403 error. The requests works fine through the browser.</p>
  
  <pre><code>POST /ajax-load-system HTTP/1.1
  Host: xyz.website.com
  Accept: application/json, text/javascript, */*; q=0.01
  Accept-Language: en-GB,en;q=0.5
  User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0
  Referer: http://xyz.website.com/help-me/ZYc5Yn
  Content-Type: application/x-www-form-urlencoded; charset=UTF-8
  X-Requested-With: XMLHttpRequest
  Content-Length: 56
  Cookie: csrf_cookie_name=a3f8adecbf11e29c006d9817be96e8d4; ci_session=ba92hlh6o0ns7f20t4bsgjt0uqfdmdtl; _ga=GA1.2.1535910352.1530452604; _gid=GA1.2.1416631165.1530452604; _gat_gtag_UA_21820217_30=1
  Connection: close
  
  csrf_test_name=a3f8adecbf11e29c006d9817be96e8d4&amp;vID=9999
  </code></pre>
  
  <p>What I am trying in python is:</p>
  
  <pre><code>import requests
  import json
  
  url = 'http://xyz.website.com/ajax-load-system'
  
  payload = {
  'Host': 'xyz.website.com',
  'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0',
  'Accept': 'application/json, text/javascript, */*; q=0.01',
  'Accept-Language': 'en-GB,en;q=0.5',
  'Referer': 'http://xyz.website.com/help-me/ZYc5Yn',
  'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
  'X-Requested-With': 'XMLHttpRequest',
  'Content-Length': '56',
  'Cookie': 'csrf_cookie_name=a3f8adecbf11e29c006d9817be96e8d4; ci_session=ba92hlh6o0ns7f20t4bsgjt0uqfdmdtl; _ga=GA1.2.1535910352.1530452604; _gid=GA1.2.1416631165.1530452604; _gat_gtag_UA_21820217_30=1',
  'Connection': 'close',
  'csrf_test_name': 'a3f8adecbf11e29c006d9817be96e8d4',
  'vID': '9999',
  }    
  
  headers = {}
  
  r = requests.post(url, headers=headers, data=json.dumps(payload))
  print(r.status_code)  
  </code></pre>
  
  <p>But this is printing a <code>403</code> error code. What am I doing wrong here? </p>
  
  <p>I am expecting a return response as json:</p>
  
  <p><code>{"status_message":"Thanks for help.","help_count":"141","status":true}</code></p>