Skip to content

Commit

Permalink
Update post request body to use JSON dumps
Browse files Browse the repository at this point in the history
  • Loading branch information
QU3B1M committed Dec 4, 2024
1 parent 65fbab3 commit d4457ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ecs/command/event-generator/event_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def send_post_request(username, password, url, event_data):
session.verify = False
headers = {'Content-Type': 'application/json'}
# Send request
response = session.post(url, json=event_data, headers=headers)
response = session.post(url, data=json.dumps(event_data), headers=headers)
if response.status_code not in [201, 200]:
logging.error(f'Error: {response.status_code}')
logging.error(response.text)
Expand Down

0 comments on commit d4457ad

Please sign in to comment.