Skip to content
Back

Function issue.

  • 0
  • Functions
UrbanExplorer
24 Jul, 2025, 18:23

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!

TL;DR
Developers are experiencing an issue where the Python runtime in their Appwrite Function is consistently receiving an empty request body for POST requests, despite valid JSON payloads being sent. Even when bypassing the frontend SDK with a direct API call using PowerShell, the issue persists. The logs show the function identifying the body as empty. It's suspected to be a platform-level problem with how HTTP request bodies are passed to Python runtimes. The developers are requesting investigation into this matter. Solution: Investigate the mechanism for forwarding HTTP request bodies to Python runtimes within Appwrite Functions.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more