How can I change the api_view decorator in the Function Based View to Class Based View? My requirement is, I want to limit the HTTP access methods such as GET, POST, PUT etc to a particular API
@api_view(['GET', 'POST'])
def hello_world(request):
if request.method == 'POST':
return Response({"message": "Got some data!", "data": request.data})
return Response({"message": "Hello, world!"})
Hope someone know the answer .....