Q:

Django Rest Framework Method \"GET\" not allowed Error?

I'm doing a CreateApiView class and this method inside class and error is : "detail": "Method \"GET\" not allowed.",
class RetractBidAPIView(ListCreateAPIView):
    permission_classes = (permissions.IsAuthenticated,)
    serializer_class = RetractBidSerializer
    queryset = ''

    def create(self, request, pk, *args, **kwargs):
        auction = get_object_or_404(Auction, pk=pk)
        date_now = datetime.now(timezone.utc)
        serializer = self.get_serializer(data=request.data,
                                      context={"request": request})

        serializer.is_valid(raise_exception=True)
        serializer.save(buyer=request.user, auction=auction)

        bid = get_object_or_404(Bid, pk=current_bid.pk)
        bid.delete()
        return Response(serializer.data, {"detail": "You bid is retracted"}, status=status.HTTP_200_OK)

A:

class RetractBidAPIView(APIView)

permission_classes = (permissions.IsAuthenticated,)

def get(self, request, *args, **kwargs):
    auction = get_object_or_404(Auction, pk=self.kwargs.get(pk)
    date_now = datetime.now(timezone.utc)
    serializer = RetractBidSerializer(data=request.data,
                                  context={"request": request})

    serializer.is_valid(raise_exception=True)
    serializer.save(buyer=request.user, auction=auction)

    bid = get_object_or_404(Bid, pk=current_bid.pk)
    bid.delete()
    return Response(serializer.data, {"detail": "You bid is retracted"}, 
                 status=status.HTTP_200_OK)

