SolarEnergy/python_device/src/api.py

8 lines
296 B
Python
Raw Normal View History

2024-06-29 16:05:58 +00:00
import requests
from src.args import args
def get_secure_origin() -> str:
res = requests.get(f"{args.unsecure_origin}/secure_origin")
if res.status_code < 200 or res.status_code > 299:
raise Exception(f"Get secure origin failed with status {res.status_code}")
return res.text