workspace working
This commit is contained in:
29
check_docs_after_clear.py
Normal file
29
check_docs_after_clear.py
Normal file
@@ -0,0 +1,29 @@
|
||||
import asyncio
|
||||
import aiohttp
|
||||
import json
|
||||
|
||||
async def get_documents(workspace):
|
||||
url = "http://localhost:3015/documents"
|
||||
headers = {
|
||||
"X-API-Key": "jleu1212",
|
||||
"X-Workspace": workspace,
|
||||
"accept": "application/json",
|
||||
}
|
||||
async with aiohttp.ClientSession() as session:
|
||||
async with session.get(url, headers=headers) as resp:
|
||||
print(f"Documents status: {resp.status}")
|
||||
if resp.status == 200:
|
||||
result = await resp.json()
|
||||
print(json.dumps(result, indent=2))
|
||||
else:
|
||||
text = await resp.text()
|
||||
print(f"Error: {text}")
|
||||
return resp.status
|
||||
|
||||
async def main():
|
||||
workspace = "test1"
|
||||
print("Checking documents after clear...")
|
||||
await get_documents(workspace)
|
||||
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(main())
|
||||
Reference in New Issue
Block a user