Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

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


User avatar
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)
  • User Avatar
    0
    ryancyq created
    Support Team

    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

  • User Avatar
    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"

  • User Avatar
    0
    ismcagdas created
    Support Team

    @worldofss

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

  • User Avatar
    0
    worldofss created

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

  • User Avatar
    0
    aaron created
    Support Team

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