【发布时间】:2021-10-08 23:15:36
【问题描述】:
我希望能够查看来自我的 react 前端的数据,并希望使用打印功能在 python 中显示结果
@api_view(["POST"])
def testfunc(request):
return JsonResponse(request,safe=False)
提前致谢
【问题讨论】:
标签: python django api django-rest-framework django-forms
我希望能够查看来自我的 react 前端的数据,并希望使用打印功能在 python 中显示结果
@api_view(["POST"])
def testfunc(request):
return JsonResponse(request,safe=False)
提前致谢
【问题讨论】:
标签: python django api django-rest-framework django-forms
你可以打印request.POST,这是一个QueryDict(一个类似字典的对象,可以包含多个项用于同一个键):
@api_view(["POST"])
def testfunc(request):
print(request.POST)
return JsonResponse(dict(request.POST.lists()))
【讨论】: