lunduke-cli/examples/check-key.py

18 lines
327 B
Python

import requests
from config.configuration import Config
cfg = Config()
username = cfg.username
url = cfg.get_api_url(endpoint='/site.json')
api_key = cfg.api_key
headers={
"api_key": api_key,
"api_username": username
}
response = requests.get(url,headers=headers)
print(response.status_code)
print(response.json())