Last post Jun 05, 2018 02:22 PM by teahou
May 31, 2018 05:55 PM|teahou|LINK
I am building an app with the the visual studio built in Angular template using .Net Core API. All the GETs work but the DELETE returns a 404 error after deploying to IIS server. Works fine on localhost.
I assume because the the project is deployed as one from VS, there is no need for CORS. Is this wrong?
Jun 01, 2018 02:39 AM|mithunvp|LINK
In your case its not needed. As the UI (client) and API both reside on same domain. If it was CORS issue then GET would not have worked.
DELETE is giving 404 means they way your calling it might be wrong.
Jun 05, 2018 08:18 AM|Brando ZWZ|LINK
As @mithunvp says, the UI (client) and API both reside on same domain, there is no need for the CORS.
The .net core angular template combine the UI and web api in the same domain, it will not cause the CORS error.
The 404 error means that the page you were trying to reach on a website couldn't be found on their server.
That means the request's url is wrong or your web api controller doesn't contains the delete action.
I suggest you could use F12 develop tool to see your request url and make sure the web api request url is right as the local side.
Jun 05, 2018 02:22 PM|teahou|LINK
I was eventually able to find a log that gave more error detail, in this case it was a 404.6 error, "Verb Denied". I was then able to find the problem was in the appsettings.config file for the server, the DELETE verb was not specifically listed as allowed.