2022-03-20 21:37:47 +03:00
|
|
|
import requests
|
|
|
|
|
2022-04-06 21:14:46 +03:00
|
|
|
# Headers for login to Akf-forum
|
2022-03-20 21:37:47 +03:00
|
|
|
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 = {
|
2022-04-06 21:14:46 +03:00
|
|
|
'status': 200,
|
|
|
|
'result': {
|
|
|
|
'authorID': 0,
|
|
|
|
'content': 'a',
|
|
|
|
'author': {
|
|
|
|
'name': 'Akif9748',
|
|
|
|
'avatar': 'https://www.technopat.net/sosyal/data/avatars/o/298/298223.jpg?1644694020',
|
|
|
|
'time': 1649189944864,
|
|
|
|
'admin': False,
|
|
|
|
'deleted': False,
|
|
|
|
'id': 0
|
2022-03-20 21:37:47 +03:00
|
|
|
},
|
2022-04-06 21:14:46 +03:00
|
|
|
'time': 1649189950166,
|
|
|
|
'threadID': 0,
|
|
|
|
'deleted': False,
|
|
|
|
'edited': False,
|
|
|
|
# Reactions: {userid: isLike (Bool)}
|
|
|
|
'react': {'0': True},
|
|
|
|
'id': 0
|
2022-03-20 21:37:47 +03:00
|
|
|
}
|
|
|
|
}
|