21 lines
394 B
Python
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())
|