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
- I can't UNPAUSE my project with the free...
I received an email notifying me that my project had been paused due to inactivity, and the email included a link to "Restore project." However, that button red...
- Error trying to deploy functions from CL...
✗ Error • on-auth-create (6a00b2ab000c9ce2949b) • Server Error ✗ Error: No functions were pushed. Prject ID: 69ffe0270033a4ac420a
- Intermittent Deploy and Execution Errors...
Project: project-fra-658e2f5f4ba30df91177 Function ID: 69bde006001c56757f49 **Several execution errors with:** Timed out waiting for runtime.\nError Code: 400...