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

@@ -33,7 +33,6 @@ if __name__ == "__main__":
service=serviceName, state=args.s, host=args.l, output=args.o, url=args.i)
# create and send request #
jsonPayload = { 'message' : message }
headers = { 'Content-Type' : 'application/json'}
jsonPayload = { 'message' : message }
url = "http://localhost:{port}/send-all".format(port=args.target_port)
requests.post(url, data=jsonPayload, headers=headers)
requests.post(url, json=jsonPayload)