Im starting a function, and when I try to parse the req.body it just doesnt work
I attached some images of my code
For example if I log(bodyParsed.userId) is just undefined
Am i doing something wrong?
Perhaps it's already parsed so you don't need to parse it again
appwrite automatically parses the req.body?
I know the error seems very dumb, but it gets very strange...
When I delete node-appwrite from the dependencies on the package.json and comment the import { Client } from 'node-appwrite', out of nowhere everything works, I can extract the userId from the req.body and the log(bodyParsed) shows as a JSON
when the node-appwrite from the package.json and import { Client } from 'node-appwrite' is present in the code it is impossible to parse the req.body, It remains as a string and recently the entire function stopped working for no reason with an error of:
Multiple internal curl errors has occurred within the executor! Error Number: 111. Error Msg: Connection refused\nError Code: 500
What could cause it?
Im using "node-appwrite": "^9.0.0", i will attach a photo of my package.json, my code and the new error that appears in the console in case that helps...
how are you executing the function?
Do you mean where I am running it from? I am using the appwrite interface, I will attach an image
This is the exact same both times you executed?
I managed to solve the error, I tried many things and I no longer know which one worked
but now it works, thanks steven
[SOLVED] function req.body problem
Recommended threads
- How to Avoid Double Requests in function...
I'm currently using Appwrite's `functions.createExecution` in my project. I want to avoid double requests when multiple actions (like searching or pagination) a...
- Project in AppWrite Cloud doesn't allow ...
I have a collection where the data can't be opened. When I check the functions, there are three instances of a function still running that can't be deleted. The...
- Get team fail in appwrite function
I try to get team of a user inside appwrite function, but i get this error: `AppwriteException: User (role: guests) missing scope (teams.read)` If i try on cl...