При загрузке selfie мы получаем ошибку 500 [закрыто]
def upload_selfie_document(self,cleardil_id,document_id,selfie_image):
url = f"{self.url}customers/{cleardil_id}/identifications"
print(url, "url")
selfie_image.seek(0)
selfie_image = selfie_image.read()
selfie_image_base64 = base64.b64encode(selfie_image).decode('utf-8')
payload = json.dumps({
'document_id': document_id,
'selfie_image': selfie_image_base64,
})
# print(payload, "payload")
headers = { **self.headers , 'Content-Type': 'application/json'}
print(headers, "headers")
try:
response = requests.post(url, headers=headers, data=payload)
print(response, "response")
if response.status_code in range(400, 505):
{response.text}")
return None
return response.json()
except Exception as e:
logger.error(f"Request exception: {str(e)}")
return None
Я пытаюсь загрузить селфи, но получаю
response <Response [500]> response