I am posting some raw JSON to my backend
{
"access_token": "hU5C7so4reJOYTzPyhKPs8PWq07tb",
"id": 3,
"order_details": [{"meal_id": 1, "quantity": 3}, {"meal_id": 2, "quantity": 2}]
}
However when I try to
print (request.POST.get("access_token"))
I receive None
But, when I do
print (request.body)
The values seem to there:
b'{\n\t"access_token": "hU5C7so4reJOYTzPyhKPs8PWq07tb",\n\t"id": 3,\n\t",\n\t"order_details": [{"meal_id": 1, "quantity": 3}, {"meal_id": 2, "quantity": 2}]\n}'
I am using Postman to post the data.
I want to store the access token into some variable like so:
access_token = request.POST.get("access_token")
with the post data
I am still fairly new to Django, any help would be great.