From 391a232f2c05b9c575fb112a0856ca8e8d513626 Mon Sep 17 00:00:00 2001 From: Sven Augustin Date: Thu, 19 May 2022 22:48:53 +0200 Subject: [PATCH] added get --- client.py | 6 ++++++ restapi.py | 3 +++ 2 files changed, 9 insertions(+) diff --git a/client.py b/client.py index e7cfd3d..34ed950 100644 --- a/client.py +++ b/client.py @@ -15,6 +15,12 @@ class Client: resp.raise_for_status() return ResponseWrapper(resp) + def get(self): + addr = f"http://{self.host}:{self.port}/" + resp = self.session.get(addr) + resp.raise_for_status() + return ResponseWrapper(resp) + class ResponseWrapper: diff --git a/restapi.py b/restapi.py index 60f814a..279056d 100644 --- a/restapi.py +++ b/restapi.py @@ -32,6 +32,9 @@ class TableAPI: rerun(self.sid) return str(self.dfh.df) + def GET(self): + return str(self.dfh.df) + # creating instances here allows to use TableAPI etc. as singletons