Complete the code to import the base class for creating a custom API view.
from rest_framework.views import [1]
The APIView class is the base class for creating custom API views in Django REST Framework.
Complete the method name to handle GET requests in a custom APIView.
class MyView(APIView): def [1](self, request): return Response({'message': 'Hello'})
The get method handles HTTP GET requests in an APIView.
Fix the error in the import statement to use the Response class correctly.
from rest_framework.[1] import Response
The Response class is imported from rest_framework.response, not from views or serializers.
Fill both blanks to define a POST method that returns a JSON message with status 201.
class CreateView(APIView): def [1](self, request): return Response({'message': 'Created'}, status=[2])
The post method handles POST requests, and status code 201 means resource created successfully.
Fill all three blanks to create a custom APIView with a GET method returning a welcome message.
from rest_framework.views import [1] from rest_framework.response import [2] class WelcomeView([3]): def get(self, request): return Response({'message': 'Welcome!'})
Import APIView and Response correctly, then subclass APIView to create the view.