DmitrMakeev
commited on
Commit
•
3d13b5c
1
Parent(s):
8e47aa9
Update app.py
Browse files
app.py
CHANGED
@@ -1640,17 +1640,27 @@ def verify_phone_number(phone_number):
|
|
1640 |
'Content-Type': 'application/json'
|
1641 |
}
|
1642 |
|
|
|
|
|
|
|
1643 |
response = requests.post(full_url_ver, headers=headers, data=payload)
|
1644 |
|
|
|
1645 |
print("Response Status Code:", response.status_code)
|
1646 |
print("Response Body:", response.text)
|
1647 |
|
|
|
1648 |
if response.status_code == 200:
|
1649 |
-
|
1650 |
-
|
1651 |
-
|
1652 |
-
|
|
|
|
|
|
|
|
|
1653 |
else:
|
|
|
1654 |
return False
|
1655 |
else:
|
1656 |
return False
|
|
|
1640 |
'Content-Type': 'application/json'
|
1641 |
}
|
1642 |
|
1643 |
+
print("Request URL:", full_url_ver)
|
1644 |
+
print("Request Payload:", payload)
|
1645 |
+
|
1646 |
response = requests.post(full_url_ver, headers=headers, data=payload)
|
1647 |
|
1648 |
+
# Выводим статус-код и тело ответа
|
1649 |
print("Response Status Code:", response.status_code)
|
1650 |
print("Response Body:", response.text)
|
1651 |
|
1652 |
+
# Проверьте, что тело ответа действительно содержит нужное поле
|
1653 |
if response.status_code == 200:
|
1654 |
+
try:
|
1655 |
+
result = response.json()
|
1656 |
+
exists_whatsapp = result.get('existsWhatsapp', False)
|
1657 |
+
print("existsWhatsapp:", exists_whatsapp) # Вывод значения переменной
|
1658 |
+
return exists_whatsapp
|
1659 |
+
except json.JSONDecodeError:
|
1660 |
+
print("Ошибка декодирования JSON")
|
1661 |
+
return False
|
1662 |
else:
|
1663 |
+
print("Ошибка ответа сервера:", response.text)
|
1664 |
return False
|
1665 |
else:
|
1666 |
return False
|