
We're facing a critical issue with our Appwrite Function where the Python runtime (context.req.body) consistently receives an empty request body for POST requests, even when a valid JSON payload is sent.
Function Logs: Our Python function's logs clearly show it executing and correctly identifying context.req.body as empty, then returning an error message like: {"success":false,"message":"Request body is empty..."}. This confirms the function itself is seeing an empty body.
Direct API Call (PowerShell): We bypassed our frontend SDK and made a direct HTTP POST request to the function's execution endpoint. Even with explicit Content-Type: application/json and ConvertTo-Json -Depth 2 for the body, the function still received an empty context.req.body.
PowerShell
$headers = @{ "X-Appwrite-Project" = "[YOUR_PROJECT_ID]" "X-Appwrite-Key" = "[YOUR_API_KEY]" } $body = @{ customerLatitude = -0.999424; customerLongitude = 37.044224 } | ConvertTo-Json -Depth 2
Invoke-RestMethod -Uri 'https://nyc.cloud.appwrite.io/v1/functions/[YOUR_FUNCTION_ID]/executions' ` -Method POST -Headers $headers -Body $body -ContentType 'application/json' | Format-List
responseStatusCode : 200 responseBody : {"success":false,"message":"Request body is empty. Expected customerLatitude and customerLongitude.","services":[]} logs : ... Error: Request body is empty.
This strongly indicates a platform-level issue where the HTTP POST request body is not being correctly passed into the context.req.body object for Python functions. Our code is correctly sending the payload, but the function's environment isn't receiving it.
Could you please investigate the mechanism for forwarding HTTP request bodies to Python runtimes within Appwrite Functions?
Thanks!
Recommended threads
- Cannot create function from CLI with KEY
I tried to setup a gitlab CI that push functions from an appwrite.json, tho when doing a first push it fails saying it needs a session. Tho it does create the f...
- Query timeout on 10 concurrent functions
Hi, I have appwrite 1.7.4 self hosted I have a Node.js function that does several operations: 1. Query a collection to get a document, currently there is a sin...
- Migrate IDs
Hi everyone, is it possible to migrate entries with an ID to another ID (like just change the ID of e.g. a database, collection, bucket, etc.)? I could write a ...
