Skip to content

Commit

Permalink
Add get_file_token method (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
thangngoc89 authored Apr 26, 2024
1 parent c69f04e commit 040cee4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pocketbase/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ def get_file_url(self, record: Record, filename: str, query_params: dict):
result += params
return result

def get_file_token(self):
res = self.send("/api/files/token", req_config={"method": "POST"})
return res["token"]

def build_url(self, path: str) -> str:
url = self.base_url
if not self.base_url.endswith("/"):
Expand Down

0 comments on commit 040cee4

Please sign in to comment.