radicale_plugins/plugins/test.py
2017-12-05 20:55:18 +01:00

14 lines
426 B
Python

import urllib.request
import json
user = "test"
password = "test2"
auth_server = "http://localhost:3500/login"
auth_client_id = "213"
auth_secret = "888"
main_uri = "{}?username={}&password={}&client_id={}&client_secret={}".format(
auth_server, user, password, auth_client_id, auth_secret)
req = urllib.request.urlopen(main_uri, data=None)
jsons = req.read()
data = json.loads(jsons)
print(data["username"], data["uuid"])