I am trying to send data in a JSON format to my django app. When I try to use POST as below, I am getting error below. So, What is wrong with my posting way or views method.
Edit:
The error message:
<pre class="exception_value">'Key \'data\' not found in <QueryDict: {u\'{ "data":\\n {\\n "name": "Something",\\n "content": "Anything"\\n }\\n}\\n\': [u\'\']}>'</pre>
<table class="meta">
<tr>
<th>Request Method:</th>
<td>POST</td>
</tr>
<tr>
<th>Request URL:</th>
<td>http://localhost:8000/api/recipes/item_new/</td>
You are posting raw JSON, not form-encoded data. You need to access
request.body:Note that this was called
request.raw_post_datain versions before 1.4.