Start to create Python client
This commit is contained in:
8
python_device/src/api.py
Normal file
8
python_device/src/api.py
Normal file
@ -0,0 +1,8 @@
|
||||
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
|
Reference in New Issue
Block a user