Open Closed

CORS policy 'Access-Control-Allow-Origin' problem with Delete #6622


0
worldofss created

I am using angular 7 and dotnet core framework I get the follwing console error when publishing to server

Access to XMLHttpRequest at 'http://000.00.00.00:22742/api/services/app/Members/Delete?Id=6' from origin 'http://000.00.00.000:4200' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.


5 Answer(s)
  • 0
    ryancyq created

    You need to add cors policy to appSettings.production.json

    similar to appSettings.json https://github.com/aspnetzero/aspnet-zero-core/blob/1c1643fa8b6aef155c3f05617920c26dd2d808d9/aspnet-core/src/MyCompanyName.AbpZeroTemplate.Web.Host/appsettings.json#L15

  • 0
    worldofss created

    hi @ryancyq i have all setting correctly and it's working with all type of requests but ony not working with "Delete"

  • 0
    ismcagdas created

    @worldofss

    Is it working with Update ? If not, you need to disable WebDAV module on IIS.

  • 0
    worldofss created

    hi @ismcagdas it's working only by disable WebDAV , but which update we should have ?

  • 0
    aaron created

    I believe @ismcagdas means "Update" (POST and PUT) requests.