You are working on a Puppy Store project which uses Django RESTful API. You have already added a unit test and you want to update the code to make it pass the test.
Which of these options will best fit the missing line of code, XXX, to perform the action given in the above context?
if request.method == ‘GET’:
serializer = PuppySerializer(puppies, many=True)
elif request.method == ‘POST’:
- return Response(serializer.data)
- Puppy = puppies.objects.all()
- serializer = PuppySerializer(puppies, many=True)
- puppies = Puppy.objects.all()