Added Api. Pocketbase. Python sdk

This commit is contained in:
2022-09-15 10:59:30 +02:00
parent 7412fd9238
commit cfe2e69125
8 changed files with 166 additions and 20 deletions

16
Api/login.py Normal file
View File

@@ -0,0 +1,16 @@
import requests
class LoginApi:
def __init__(self, email: str, password: str):
self.email = email
self.password = password
self.api_basepath = "http://127.0.0.1:8090/api"
self.login_endpoing = "/admins/auth-via-email"
def login(self):
credentials = {"email": self.email, "password": self.password}
print(self.api_basepath + self.login_endpoing)
res = requests.post(self.api_basepath +
self.login_endpoing, credentials)
return res.json()