Start CLI implementation
This commit is contained in:
14
cli/connection.py
Normal file
14
cli/connection.py
Normal file
@@ -0,0 +1,14 @@
|
||||
# api_client.py
|
||||
import requests
|
||||
from config import CONFIG
|
||||
|
||||
def login(username, password):
|
||||
url = f"{CONFIG['server']['url']}/login"
|
||||
payload = {'username': username, 'password': password}
|
||||
response = requests.get(url, params=payload)
|
||||
return response
|
||||
|
||||
def logout():
|
||||
url = f"{CONFIG['server']['url']}/logout"
|
||||
response = requests.get(url)
|
||||
return response
|
||||
Reference in New Issue
Block a user