12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- import requests
- url = 'http://127.0.0.1:9000/v1/token'
- data = {
- 'username': 'admin',
- 'password': '123456',
- }
- response = requests.post(url=url, json=data)
- code = response.json().get('code')
- token = response.headers.get('authorization')
- url = 'http://127.0.0.1:9000/v6/api'
- data = {
- 'code': 3001,
- 'page': 1,
- 'size': 3,
- 'pid': '',
- 'driver_name': '',
- }
- response = requests.post(url=url, json=data, headers={'authorization': token})
- print(response.json())
- """
- {
- 'code': 0,
- 'data': [
- {
- 'uuid': '65dbe96949fbe311a3a01d30',
- 'pid': 'AA112233',
- 'start_time_at': 1708917227,
- 'end_time_at': 1708946027,
- 'driver_name': '张三',
- 'cockpit_name': '1号舱'
- }
- ],
- 'total': 1,
- 'page': 1,
- 'size': 3
- }
- """
|