Back

transfer data from flutter to appwrite dart function

  • 0
  • Flutter
  • Functions
YahalomS
19 May, 2024, 18:40

I am trying to transfer data from the Front-End (Flutter) to AppWrite function with dart 3.1 runtime I have previously managed to do it with Node.js, but in Dart it is not working form me.

This is an example of front End Code

Future<Map<String, dynamic>> runFunctionExecution( ) async { var funcRes = await functions.createExecution( functionId: FunctionId, body: jsonEncode({ "headers": "The Headers for test", "body": "The body for test ", }), );

This is the function I am deploying to AppWrite

Future main(final context) async { context.log(jsonEncode(context.req.body)); context.log(jsonEncode(context.req.payload)); }

It is deploying successfully and log shows the result , but cannot see my data sent from the front-end.

I am definitely missing something in reading the req data Tried every possible thing I could think of, no luck

TL;DR
Developers want to transfer data from Flutter to AppWrite Dart function, but are facing issues with reading the data on the backend function side. The data sent from the front-end is not appearing. They have tried various methods without success. **Solution:** Make sure the data sent from Flutter is properly formatted and check how the backend function is reading the request body and payload. Ensure that the data is being correctly parsed and accessed on the AppWrite side.
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