获取guacamole中token的方法(其他网页同样适用)

代码

import requests
def get_train_token():
    url = "http://192.168.8.120:9090/guacamole/api/tokens"
    body = {
        "username":"guacadmin",
        "password":"guacadmin"
    }
    result = requests.post(url=url, data=body).json()
    print(result)


get_train_token()

结果

{'authToken': 'BEAFBD0CEF10DF382F25ABA1E953792D19248DC004B87AF390534B167E82CB7B', 'username': 'guacadmin', 'dataSource': 'mysql', 'availableDataSources': ['mysql', 'mysql-shared']}

你可能感兴趣的:(android)