实现方式
视图
class Test(ViewSetMixin, APIView):
def test1(self, request):
return HttpResponse('ok')
def test2(self, request):
return HttpResponse('ok')
路由
url(r'^test/', views.Test.as_view({'get': 'test1', 'post': 'test2'})),
实现方式
视图
class Test(ViewSetMixin, APIView):
def test1(self, request):
return HttpResponse('ok')
def test2(self, request):
return HttpResponse('ok')
路由
url(r'^test/', views.Test.as_view({'get': 'test1', 'post': 'test2'})),
转载于:https://www.cnblogs.com/liangchengyang/p/10435383.html