Skip to content

Commit ed81111

Browse files
committed
fix: function url curls with body data
1 parent 0934e05 commit ed81111

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

index.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@ def handler(event, context):
1111
# Log the input event for debugging purposes
1212
print("Received event:", json.dumps(event, indent=2))
1313

14+
if "body" in event:
15+
try:
16+
event = json.loads(event["body"])
17+
except json.JSONDecodeError:
18+
return {
19+
"statusCode": 400,
20+
"body": "Invalid JSON format in the body. Please check the input."
21+
}
22+
1423
if "message" not in event:
1524
return {
1625
"statusCode": 400,

0 commit comments

Comments
 (0)