This commit is contained in:
redfast00 2019-08-02 20:52:58 +02:00
parent 479bd938bd
commit c204e9a38e
No known key found for this signature in database
GPG key ID: 5946E0E34FD0553C

View file

@ -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)