lunduke-cli/examples/check-key.py
2025-04-11 22:46:02 +01:00

21 lines
394 B
Python

import requests
host = 'forum.lunduke.com'
username = 'gmgauthier'
url = f"https://{host}/posts.json"
with open('../keys/cli_key.txt', 'r') as key:
api_key = key.read()
api_key = api_key.replace('\n', '').replace('\r', '')
headers={
"api_key": api_key,
"api_username": username
}
response = requests.get(url,headers=headers)
print(response.status_code)
print(response.json())