1、params
django 中接收前端post传递的params
class IntoLibraryViews(APIView):
def get(self, *args):
data = {
'msg': '成功',
'status': status.HTTP_200_OK
}
return Response(data)
def post(self, request, *args):
要使用query_params接收
print(request.query_params)
return Response(data={'msg': '成功'})
2、body
initialize_datas = json.loads(reuqest.body)
3、form
request.POST