v.0.11.0 ap-server & pico-client
This commit is contained in:
20
pico-client/tryout/api_server_checker.py
Normal file
20
pico-client/tryout/api_server_checker.py
Normal file
@@ -0,0 +1,20 @@
|
||||
import urequests # type: ignore
|
||||
import json
|
||||
|
||||
BASE_API_URL: str = "http://0.0.0.0:8000"
|
||||
|
||||
|
||||
class API_Server_Checker:
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
def _get_items(self):
|
||||
items_url: str = f"{BASE_API_URL}/items"
|
||||
print(f"query: {items_url}")
|
||||
r = urequests.get(items_url)
|
||||
print("Status-Code:", r.status_code)
|
||||
json_resp = r.json()
|
||||
print("json_resp:", json_resp)
|
||||
|
||||
def check(self):
|
||||
self._get_items()
|
||||
Reference in New Issue
Block a user