From 040cee42c081a69faacb949f02d11190ed0e5676 Mon Sep 17 00:00:00 2001 From: Khoa Nguyen Date: Fri, 26 Apr 2024 23:28:16 +0800 Subject: [PATCH] Add get_file_token method (#84) --- pocketbase/client.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pocketbase/client.py b/pocketbase/client.py index 1aa8d32..5901dcf 100644 --- a/pocketbase/client.py +++ b/pocketbase/client.py @@ -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("/"):