Метод post не разрешен при использовании ключа API Django REST Framework

    def get_permissions(self):
        """
        Override the default permissions for the view.
        """
        try:
            if 'bot' in self.request.path:
                print(f'post cheque')
                return [HasAPIKey()]
            # Return the custom permission classes for the current action.
            return [permission() for permission in self.serializers_permission_by_action[self.action][1]]
        except KeyError:
            # If the current action is not found in serializers_permission_by_action,
            # default to using the standard permissions.
            return super().get_permissions()


api_key1 = 'YOtxWIRR.OGgGvTaND1OEKJYvDtLAmBnR8tFFFTxz'
headers = {'X-Api-Key': api_key1 }

Метод post не работает в DRF API Key

я получаю результаты для метода get

но для метода post он говорит, что метод не разрешен

Вернуться на верх