forked from Kelder/cammiechat
code
This commit is contained in:
parent
479bd938bd
commit
c204e9a38e
1 changed files with 2 additions and 1 deletions
3
chat.py
3
chat.py
|
@ -91,9 +91,10 @@ def messages_post():
|
|||
|
||||
messages.append(Message(time, sender, sendertype, str(message, "UTF-8")))
|
||||
url = 'http://10.0.5.42:8000/' # Set destination URL here
|
||||
post_fields = {'X-Messages': base64.b64encode(message)} # Set POST fields here
|
||||
post_fields = {'X-Messages': base64.b64encode(message)}
|
||||
|
||||
assembly_request = urllib.request.Request(url, urlencode(post_fields).encode())
|
||||
assembly_request.add_header('X-Messages', base64.b64encode(message))
|
||||
urllib.request.urlopen(assembly_request).read().decode()
|
||||
speak(message)
|
||||
|
||||
|
|
Loading…
Reference in a new issue