diff options
| -rw-r--r-- | index.py | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -18,16 +18,20 @@ old_message = "" @app.route('/', methods=['POST']) def handle_post_request(): global old_message + dbug= { + 'content': "cao" + } + requests.post(url, headers=header, data=dbug)#DEBUGGGG======= message = request.get_data().decode('utf-8') + requests.post(url, headers=header, data=dbug)#DEBUGGGG======= + isFile = False if message.split(maxsplit = 1)[0] == "FILE": isFile = True + # Check if the message is different from the previous one - dbug= { - 'content': "cao" - } + requests.post(url, headers=header, data=dbug)#DEBUGGGG======= - requests.post(url, headers=header, data=dbug) if message != old_message: payload = { 'content': message @@ -40,10 +44,10 @@ def handle_post_request(): files = { "file" : (file[0],file[1].decode('ascii')) # The picture that we want to send in binary } - requests.post(url, headers=header, data=dbug) + requests.post(url, headers=header, data=dbug)#DEBUGGGG======= response = requests.post(url, headers=header, data=payload, files=files) - requests.post(url, headers=header, data=dbug) + requests.post(url, headers=header, data=dbug)#DEBUGGGG======= else: response = requests.post(url, headers=header, data=payload) |
