Added Api. Pocketbase. Python sdk
This commit is contained in:
16
Api/login.py
Normal file
16
Api/login.py
Normal 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()
|
||||
Reference in New Issue
Block a user