django require_POST body code example
Example: django require_POST body
# body -> {"name":"foo", "surname":"bar}
def my_view(request):
print(request.POST) # print the QueryDict object
print(request.POST.get('name') # print foo
# body -> {"name":"foo", "surname":"bar}
def my_view(request):
print(request.POST) # print the QueryDict object
print(request.POST.get('name') # print foo