I have made several attempts to authenticate with my API
using RequestsClient or CoreapiClient and both have failed. For example:
from rest_framework.test import CoreAPIClient, RequestsClient
from requests.auth import HTTPBasicAuth
from requests import Session
#this code works
client = Session()
client.auth = HTTPBasicAuth('xxxxx', 'xxxx123!')
client.post(url)
#this on the other hand fails and says Invalid username/password
client = RequestsClient()
client.auth = HTTPBasicAuth('xxxxx', 'xxxx123!')
client.post(url)
Is there anyone having this same issue? please help.
--
You received this message because you are subscribed to the Google Groups
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.