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
- 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...