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
- Why does this happen?
`AppwriteException: general_argument_invalid, Invalid `secret` param: Value must be a valid string and at least 1 chars and no longer than 256 chars (400)` the...
- Selfhosted starter python function retur...
I am running a selfhosted appwrite instance. Creating a node function and executing it works just fine but when i try to execute a python starter function, i ge...
- Can't run functions from console in appw...
Hello, I have an appwrite 1.9.0 self hosted, functions run correctly with client SDK or event when using the function domain *.function.mydomain, for testing pu...