Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
443 views
in Technique[技术] by (71.8m points)

Django, DRF: How to send permission class details while making an API call using POSTMAN?

# views.py

@login_required
@permission_classes([IsAdminUser])
@api_view(['GET'])
def say_hi_admin(request):
    return Response('Hi Admin')

On making a GET request using POSTMAN with the following request Body(raw/json):

{
    "user": {
        "id": 1,
        "email": "[email protected]",
        "password": "pass"
    }
}

But I get this as the response,

{
    "detail": "Authentication credentials were not provided."
}

How can I solve this?

question from:https://stackoverflow.com/questions/66061786/django-drf-how-to-send-permission-class-details-while-making-an-api-call-using

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...