1👍
I’d say, it’s just a wrong URL in your call of the external API, as you are using some path without a domain.
So instead of
res = requests.post('external/api/url', headers=headers, data=payload, cert=(crt,key))
it should be sth. like
res = requests.post('https://SOMEDOMAIN.ORG/external/api/url', headers=headers, data=payload, cert=(crt,key))
0👍
Within the res = requests.post('external/api/url', headers=headers, data=payload, cert=(crt,key))
, I had to change data=payload
to data=json.dumps(payload)
. I’m assuming it didn’t like the way I formatted my payload initially. After that, I also deleted everything but the Content-Type: application/json
out my headers
dictionary.
- [Answered ]-Django-allauth running in SSL
- [Answered ]-Remove empty objects from the Django query results
- [Answered ]-Authenticate function returning none in login api view django
- [Answered ]-How to use django-avatar with my own User model and not with django.contrib.auth.models.User
- [Answered ]-Django – revisiting "change password at next login”
Source:stackexchange.com