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
- Function domain not available
Hello, even tho in docs you clearly describe that every function has its domain, I can not see it anywhere in any of my projects. How do I reveal the url of th...
- Inquiry: How to Reduce Cold Start Durati...
Hey! I was using Python for the function runtime, but after reading that Go has the fastest runtime, I switched my code over to Go. However, I'm still seeing co...
- After a GET request is passed to functio...
Create execution in the console can normally retrieve the get parameters。WHy?