including Basic Authentication to an API request code example
Example 1: api authentication work in your project
I use bearer tokens in my current framework.
I send a get request to special API endpoint by providing valid
credentials, then it will return Access Token. I use that token
in my request header and access other API endpoints
Example 2: basic authentication in REST api Dajngo
REST_FRAMEWORK = {
'DEFAULT_AUTHENTICATION_CLASSES': [
'rest_framework.authentication.BasicAuthentication',
'rest_framework.authentication.SessionAuthentication',
]
}