i have a lamda delete request on aws serverless in there ive wrote in serverless.yaml all the
cors needed : cors:
STILL im getting errors that DELETE' is unsupported in no-cors mode.
did anyone had the same problem?
Thank you
origin: '*' # <-- Specify allowed origin
headers: # <-- Specify allowed headers
- Content-Type
- X-Amz-Date
- Authorization
- X-Api-Key
- X-Amz-Security-Token
- X-Amz-User-Agent
and in my ui(react js), i have the fallowing fetch request :
const delteFoster = async (delid) => await fetch('URL' + delid, {
method: "DELETE",
cache: 'no-cache', // *default, no-cache, reload, force-cache, only-if-cached
credentials: 'same-origin', // include, *same-origin, omit
mode:'no-cors',
headers: {
'Content-Type': 'application/json',
'Access-Control-Allow-Origin': '*',
},
})
.then(res => res.text()) // or r
even when i remove the 'no cors' attr in my request i still have the allow origin header and its not wotking