Hi, when I send a request using js to my function, the request method changes from POST to OPTIONS. It works as POST on postman, or python script, but not when I use js.. anyone seen this before?
fetch(apiUrl, {
method: 'POST',
headers: myHeaders,
body: JSON.stringify(data),
redirect: "follow"
// body: JSON.stringify({
// data: JSON.stringify(data), // Data needs to be a string inside the outer JSON payload
// async: false
// })
})
I tried the 2 approaches above..
Are you making this request from a web app? If so, it's expected. Browsers make an OPTIONS call first to check for CORS
Recommended threads
- Broken Appwrite can’t make functions nor...
Hii guys, I was having this issue with my locally hosted Appwrite, I can’t create functions ( both template and manual), I can’t make a custom domain ( like in ...
- Tips for Debugging Appwrite Functions Lo...
Hi everyone! 👋 I have an Appwrite Function running locally with Docker, but I’m struggling to debug it because execution doesn’t reach the breakpoints I set. ...
- AttributeError: 'Context' object has no ...
I'm getting an error executing my function. I'm not able to replicate this locally since I have to use a mock context. Is there a way to debug this kind of erro...