title: How can I limit http method to a Django REST api
body: <p>How can I change the  <strong>api_view</strong> 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</p>
  
  <pre><code>@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!"})
  </code></pre>
  
  <p>Hope someone know the answer .....</p>