
This has been asked before but as far I couldn't find a resolution. In my Function on Appwrite Cloud I have the following code:
TypeScript
const requestBody = JSON.stringify(req.bodyRaw);
log('Request body:', requestBody);
const requestJson = JSON.parse(requestBody);
log('Request JSON:', requestJson);```
Which results in:
```Request method:
Request body:
Request JSON:```
From my frontend I call the function like this:
```functions.createExecution(
'function-id',
JSON.stringify({
foo: 'bar',
lorem: ipsum,
}),
false,
'/',
ExecutionMethod.POST,
{
'content-type': 'application/json'
}
).then((response) => {
console.log(response);
}
);```
Is there anything that I'm not seeing and doing wrong?
TL;DR
The developers are experiencing an issue with the req object being empty in their Function on Appwrite Cloud. They are logging the request method, request body, and request JSON but only receiving empty values. The solution is to ensure that the request payload is being sent correctly from the frontend to the function. The issue may lie in how the data is being passed or in the headers being set. They should double-check the payload structure and the content type being sent.Recommended threads
- [SOLVED] Appwriteexception: invalid redi...
I've been following this documentation on my app: https://appwrite.io/docs/tutorials/nextjs-ssr-auth/step-7 On Localhost and local development, it's working fi...
- Help for Appwrite sites domain setup (se...
When installing appwrite locally, how should i set up the domains? i've got: `services.site.com` -> appwrite dashboard `sites.site.com` -> same ip and port `fu...
- Appwrite being constantly slow and over-...
As can we can from image we are getting same warnings, and the appwrite is unresponsive. Steps Taken: -Disabled Appwrite stats. Made my app really cache heavy,...
