Is this a valid POST request ? I am getting a 500 server error. However if I perform a GET request I can receive the default response.
SvelteKit page.sever.ts code:
TypeScript
const response = await fetch("http://<url>.appwrite.global/",
{
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify(arrayIds),
});
Appwrite function code:
TypeScript
from appwrite.client import Client
import os
import json
def main(context):
if context.req.method == "POST":
return context.res.send("Response to a POST request")
return context.res.json({
"Response": "Default response",
})
TL;DR
Developers are getting a 500 server error when sending a POST request, but a GET request works fine. Check the code for the POST request function and make sure it's correct. Additionally, ensure the Appwrite function properly handles POST requests.Recommended threads
- TablesDB can't be used in Appwrite Funct...
I have written a function (DART) and it won't deploy. Here is what I get : 2026-03-14T17:09:41.459693680Z Compiling ... 2026-03-14T17:09:42.915619217Z ../build...
- Realtime for files() works almost well, ...
I have been trying to make use of realtime, today (14.03.26) I have pulled all the latest versions of docker images, and sdk available. Whats working: - Conn...
- Function issue
Hi,idk whats wrong with my function but i made some changes to the env var and made sure they saved then i redeployed it,but then after it redeeployed it asked ...