In [1]:
import requests
In [ ]:
 
In [ ]:
 
In [ ]:
 
In [39]:
data = {
    "username": "admin",
    "password": "password"
}
rs = requests.post("http://192.168.31.78:7777/login", json=data)
print(rs.status_code)
data = rs.json()
print(data)
token = data["token"]
200
{'exp': '2020-01-26T21:48:17.181671', 'message': 'auth ok', 'token': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6ImFkbWluIiwiZXhwIjoxNTgwMDc1Mjk3fQ.Sn4-XksxT2zww6eCHtcbuyDZKjUVMEM3MQyLocJkaQE'}
In [ ]:
 
In [57]:
data = {
    "token": token
}
data = {}
rs = requests.post("http://192.168.31.78:7777/", json=data)
print(rs.status_code)
print(rs.json())
403
{'message': 'protected auth failed'}
In [ ]:
 
In [ ]:
 
In [ ]:
 
In [ ]:
 
In [ ]:
 
In [ ]:
 
In [ ]: