xumu_iotdb/config.py

18 lines
465 B
Python

# 数据库插入类型
import base64
# url
baseHost = "https://iot.lihaink.cn/iotdb_restapi"
# 注意这里前面不能加/
insertUri = "rest/v2/insertRecords"
queryUri = "rest/v2/query"
nonQueryUri = "rest/v2/nonQuery"
# 鉴权
username = 'root'
password = 'root'
code = (username + ":" + password).encode("utf-8")
token = base64.encodebytes(code).decode("utf-8").strip()
headers = {
'ContentType': 'application/json',
'Authorization': "Basic " + token
}