Rank 2: Process
Last day I deployed a function to my selfhosted Appwrite and its working fine when I execute it from console.
It even worked fine when I execute a GET request from my Flutter Windows App.
But It is showing following error when a POST request executed from Flutter App:
File "/usr/local/server/src/server.py", line 210, in handler return await action(request) File "/usr/local/server/src/server.py", line 131, in action context.req.body = request.get_json(force=True, silent=False) File "/usr/local/server/src/function/runtime-env/lib/python3.9/site-packages/werkzeug/wrappers/request.py", line 623, in get_json rv = self.on_json_loading_failed(e) File "/usr/local/server/src/function/runtime-env/lib/python3.9/site-packages/flask/wrappers.py", line 131, in on_json_loading_failed raise BadRequest()werkzeug.exceptions.BadRequest: 400 Bad Request: The browser (or proxy) sent a request that this server could not understand.```
My Flutter Code:
```Execution result = await _functions.createExecution( functionId: AppwriteCredentials.hookGeneratorFunctionId, body: "{'user_message': $userInputText}", // optional method: ExecutionMethod.pOST, // optional headers: {"Content-Type": "application/json"}, // optional );```