When I send a delete request to a specific endpoint, for example using httpie from a terminal, for example
http delete http://localhost:8181/admin/applications/uspecs
I get the correct behavior, as in { success: true } as the 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, I get
Fetch API cannot load http://localhost:8181/admin/applications/uspecs. Method DELETE is not allowed by Access-Control-Allow-Methods in preflight response.
error in the console. What am I missing? I get a valid list of methods on request options.
source share