Help to extract the keys from the POST request. I send a request to Django from a third-party application and then I want to process it, but when I try to extract the keys, an empty dictionary is returned from me for some reason. the request itself is sending postmen[email protected]

def index (request):
    if request.method== 'POST':
        req= request.body.decode ('utf-8')
        print (f'The request itself received by {request} ')
        print (f 'request code {req}')
    return HttpResponse (0)

on prints outputs

The request itself received by < WSGIRequest: POST '/[email protected]'>decode request

What are the keys? {'email': '[email protected]'}, right?

nomnoms122021-02-23 12:12:50

yes, exactly what i need, but how did you get them?

Alex Ua2021-02-23 13:54:46

request.GET as in the response.

nomnoms122021-02-23 13:56:06
  • Answer # 1


    That is, you need: