Answer the question
In order to leave comments, you need to log in
How to extract data from json POST request in Django?
I'm trying to confirm the server for the VK application, VK sends a request { "type": "confirmation", "group_id": 156694511 } view
:
def handshake(request):
if request.method == 'POST':
data = dict(request.POST)
if data['type'] == 'confirmation':
return HttpResponse('token')
return HttpResponse('Not POST')
Answer the question
In order to leave comments, you need to log in
How do you send a request? If the request is via Axios then the data will be inrequest.body
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question