use the json shortcut for request

This commit is contained in:
Yannik Schmidt
2020-06-11 00:15:32 +02:00
parent b980a2069b
commit 74b9b548ec

View File

@@ -34,6 +34,5 @@ if __name__ == "__main__":
# create and send request #
jsonPayload = { 'message' : message }
headers = { 'Content-Type' : 'application/json'}
url = "http://localhost:{port}/send-all".format(port=args.target_port)
requests.post(url, data=jsonPayload, headers=headers)
requests.post(url, json=jsonPayload)