Added sending JSON RPC command
This commit is contained in:
parent
9e411e6a12
commit
3f1012a28b
@ -53,8 +53,16 @@ class GUI:
|
||||
rpc = json.dumps({"id": 1, "method": "login", "params": [ username, password ] })
|
||||
|
||||
headers = {"Content-Type": "application/json", "Accept": "application/json", "Content-Encoding": "utf-8"}
|
||||
conn = httplib.HTTPConnection("oogway.brokernet-group.local", 443)
|
||||
conn = httplib.HTTPConnection("localhost", 80)
|
||||
conn.request("POST", url, rpc, headers)
|
||||
response = json.loads(conn.getresponse().read())
|
||||
|
||||
token = response['result']
|
||||
|
||||
rpc = json.dumps({"id": 2, "method": "send", "params": [token, rcpt, message, []]})
|
||||
|
||||
conn.request("POST", url, rpc, headers)
|
||||
print conn.getresponse().read()
|
||||
def main():
|
||||
app = GUI()
|
||||
Gtk.main()
|
||||
|
Loading…
Reference in New Issue
Block a user