Skip to content

Commit

Permalink
Update http and https way to send get request
Browse files Browse the repository at this point in the history
  • Loading branch information
CoolCoderCarl committed Apr 23, 2024
1 parent dbcad6a commit bd88a92
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,18 @@ def http_requests(hosts: list):
"""
try:
for h in hosts:
print(h)
response = requests.get(f"https://{h}")
print(response)
except requests.exceptions.BaseHTTPError as icmp_err:
logging.error(f"ICMP Error - {icmp_err}")
try:
print(h)
response = requests.get(f"https://{h}")
# response = requests.get(f"https://{h}", verify=False)
print(response)
except requests.exceptions.SSLError as ssl_err:
logging.error(f"SSL Error - {ssl_err}")
print(h)
response = requests.get(f"http://{h}")
print(response)
except requests.exceptions.BaseHTTPError as base_http_err:
logging.error(f"BASE HTTP Error - {base_http_err}")
# SEND
# telegram_sender.send_alert_to_telegram("something happend")

Expand Down

0 comments on commit bd88a92

Please sign in to comment.