1👍
You access this with request.POST
, so:
def webhook(request):
if request.method == 'POST':
Client.objects.create(
first_name=request.POST['FirstName'],
last_name=request.POST['LastName'],
phone=request.POST['Phone1'],
email=request.POST['Email']
)
return HttpResponse(request.body, status=200)
But usually it is better to process data with forms [Django-doc]: these can perform validation, cleaning, and a ModelForm
can save this to a model object in the database.
Source:stackexchange.com