fix: add timeout to POST request

This commit is contained in:
2022-12-30 20:20:30 +00:00
parent cf290152c5
commit d0fda23a58

View File

@ -26,7 +26,8 @@ def send_page(name: str, email: str, message: str) -> tuple:
req = requests.post( req = requests.post(
api_url, api_url,
json=payload, json=payload,
headers={'Content-Type': 'application/json'} headers={'Content-Type': 'application/json'},
timeout=5
) )
if req.status_code == 200 and req.json().get('status') == 1: if req.status_code == 200 and req.json().get('status') == 1: