-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
27 lines (24 loc) · 716 Bytes
/
test.py
File metadata and controls
27 lines (24 loc) · 716 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import json
import requests
# create a token
r = requests.post("http://localhost:8000/token")
token = r.json()["token"]
r = requests.post(
f"http://localhost:8000/{token}", data=json.dumps({"test": "testé"})
)
r = requests.post(
f"http://localhost:8000/{token}", data=json.dumps({"test": "test"})
)
r = requests.post(
f"http://localhost:8000/{token}", data=json.dumps({"test": "test"})
)
r = requests.post(
f"http://localhost:8000/{token}", data=json.dumps({"test": "test"})
)
r = requests.post(
f"http://localhost:8000/{token}", data=json.dumps({"test": "test"})
)
r = requests.get(f"http://localhost:8000/token/{token}/requests")
response = r.json()
for e in response["data"]:
print(e)