123456789101112 |
- import json
- import requests
- import connection
- host = 'http://127.0.0.1:' + str(connection.port)
- headers = {'Content-type': 'application/json', 'Accept': 'text/plain'}
- r = requests.post(host + '/register', data=json.dumps({"username": "user1", "password": "qwertz"}), headers=headers)
- print(r.content)
- r = requests.post(host + '/login', data=json.dumps({"username": "user1", "password": "qwertz"}), headers=headers)
- print(r.content)
|