Send Post Data from python to django
<p>i'm trying to transfer data from script in tempermonkey ( read userinput by form) to django.
Transfer works, but i can't use data in python (I think I'm doing something wrong in the format).</p>

<p>This is my script example in tempermonkey:</p>

<pre><code>GM_xmlhttpRequest({
  method: "POST",
  url: "www.example.com",
  data: datasend,
  headers: {
    "Content-Type": "application/x-www-form-urlencoded"
  },
  onload: function(response) {
    alert(response.responseText);
  }
});
</code></pre>

<p>datasend contain an array of objects like this:</p>

<pre><code> [{"name" : "Pippo" , "surname" : "Pluto" , "address" : "street xxx" , "number" : "1234"},{"name" : "aaa" , "surname" : "bbb" , "address" : "street xxx" , "number" : "4321"},{"name" : "y" , "surname" : "x" , "address" : "street xxx" , "number" : "333"}]
</code></pre>

<p>This is my view.py</p>

<pre><code>def index(request):
    data=request.POST
    dataTransform=(json.loads(json.dumps(request.POST)))
    return HttpResponse(dataTransform)
</code></pre>

<p>The response is:</p>

<pre><code>(u'[{"name" : "Pippo" , "surname" : "Pluto" , "address" : "street xxx" , "number" : "1234"},{"name" : "aaa" , "surname" : "bbb" , "address" : "street xxx" , "number" : "4321"},{"name" : "y" , "surname" : "x" , "address" : "street xxx" , "number" : "333"}]',u")
</code></pre>

<p>a dict with length=1. How can I access each element?
My goal is to save this information in Database.</p>

<p>Thanks for your help!</p>