I try to test a view, I receive a json request from the IPad, the format is:
req = {\"custom_decks\": [
{
\"deck_name\": \"deck_test\",
python 3.6
and django 2.0
:
post_json = json.loads(request.body)
custom_decks = post_json.get("custom_decks")
json.loads(s, *, encoding=None,...)
Changed in version
3.6
:s
can now be of typebytes
orbytearray
. The input encoding should beUTF-8
,UTF-16
orUTF-32
.
From python 3.6
NO need request.body.decode('utf-8')
.