title: Unable to POST to Grafana using Python3 module requests
body: <p>I'm trying to create a dashboard on Grafana using their backend API. I first test that my API token is set up by using GET and successfully get a return code of 200(shown below). I then try to use POST to create a simple dashboard but I keep getting a return code of 400. I'm pretty sure it has something to do with the payload I'm trying to send, but I have been unable to figure it out. Here is the link to the example page I'm using for their JSON format. <a href="http://docs.grafana.org/reference/http_api/" rel="nofollow">http://docs.grafana.org/reference/http_api/</a></p>
  
  <pre><code>import requests
  
  
  headers = {"Accept": "application/json","Content-Type": "application/json" ,"Authorization": "Bearer xxx"}
  
  r = requests.get("http://www.localhost",headers=headers)
  print(r.text)
  print(r.status_code)
  
  
  
  dashboard = {"id": None,
               "title": "API_dashboard_test",
               "tags": "[CL-5]",
               "timezone": "browser",
               "rows":"[{}]",
               "schemaVersion": 6,
               "version": 0
               }
  payload = {"dashboard": "%s" % dashboard}
  url = "http://www.localhost/api/dashboards/db"
  
  p = requests.post(url,headers=headers, data=payload)
  print(p)
  print(p.status_code)
  print(p.text)
  </code></pre>
  
  <p>OUTPUT:</p>
  
  <pre><code>200
  &lt;Response [400]&gt;
  400
  [{"classification":"DeserializationError","message":"invalid character 'd' looking for beginning of value"},{"fieldNames":["Dashboard"],"classification":"RequiredError","message":"Required"}]
  </code></pre>