When I send a delete request to a certain endpoint, for example with httpie from terminal like
http delete http://localhost:8181/admin/applications/uspecs
I get a valid behavior, as in { success: true }
as response body.
But when I do
fetch (
'http://localhost:8181/admin/applications/uspecs',
{ method: 'DELETE' }
)
.then(res => doSomethingWithResponse())
.catch(err => console.error(err))
In javascript code, then I get a
Fetch API cannot load http://localhost:8181/admin/applications/uspecs.
Method DELETE is not allowed by Access-Control-Allow-Methods in preflight response.
error on the console. What am I missing? I am getting a valid methods list on options request.