2022-03-20 21:37:47 +03:00
|
|
|
import requests
|
|
|
|
|
|
|
|
# Headers for login to Akf-forum
|
|
|
|
headers = {
|
|
|
|
"username": "testUser",
|
|
|
|
"password": "testPassword"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-04-03 22:03:47 +03:00
|
|
|
r = requests.get("http://localhost:3000/api/messages/1/", headers=headers)
|
2022-03-20 21:37:47 +03:00
|
|
|
|
|
|
|
print(r.json())
|
|
|
|
|
|
|
|
example_response = {
|
|
|
|
"status": 200,
|
|
|
|
"result":
|
|
|
|
{ # content of message
|
|
|
|
"content": "a",
|
|
|
|
# author of message
|
|
|
|
"author": {
|
|
|
|
"name": "ForumcuCocuk",
|
|
|
|
"avatar": "/images/guest.png",
|
|
|
|
"time": 1647177723873,
|
|
|
|
"admin": True,
|
|
|
|
"id": 1
|
|
|
|
},
|
|
|
|
# UNIX Timestamp of message
|
|
|
|
"time": 1647178873587,
|
|
|
|
# thread information of message
|
|
|
|
"thread": {
|
|
|
|
"author": {
|
|
|
|
"name": "ForumcuCocuk",
|
|
|
|
"avatar": "/images/guest.png",
|
|
|
|
"time": 1647177723873,
|
|
|
|
"admin": True,
|
|
|
|
"id": 1
|
|
|
|
},
|
|
|
|
"title": "My",
|
|
|
|
"messages": [0], # ids of messages
|
|
|
|
"time": 1647178870047,
|
|
|
|
"deleted": False,
|
2022-03-21 23:53:22 +03:00
|
|
|
"id": 0
|
2022-03-20 21:37:47 +03:00
|
|
|
},
|
|
|
|
# Other informations about message
|
|
|
|
"deleted": False,
|
|
|
|
"edited": False,
|
|
|
|
"react": {},
|
2022-03-21 23:53:22 +03:00
|
|
|
"id": 1
|
2022-03-20 21:37:47 +03:00
|
|
|
}
|
|
|
|
}
|