Skip to content
Snippets Groups Projects
Verified Commit 9753a32b authored by Torsten Grote's avatar Torsten Grote
Browse files

Move to new JSON POST format

parent 677277c9
No related branches found
No related tags found
No related merge requests found
......@@ -52,8 +52,11 @@ def get_message_stdin(token):
while True:
body = input(PROMPT)
if len(body) > 0:
res = requests.post(URL, headers=get_auth_header(token), data={'message': body}).json()
print_message(res)
res = requests.post(URL, headers=get_auth_header(token), json={'text': body})
if res.status_code == 200:
print_message(res.json())
else:
print("Error: %d" % res.status_code)
def print_message(message):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment