I have a .net core mvc application published on iis and when i use delete request i get 401 Unauthorized Error.
Can someone help me fix it?
I found a case with the same problem as yours on stackoverflow, you can try this solution:
Enable delete verb on the iis server -> .NET Authorization Rules.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Not sure what you want us to help you with here. 401 means you are attempting to do something you don't have permission to do. Since you wrote the code you should verify that the code that calls this API is passing whatever user credentials your app uses. You should then look at the corresponding action on the server side and ensure you're getting the credentials. If this is the only place you are having this issue but you require authentication for all other endpoints then the problem is with the calling code. If none of your endpoints work then it would be a deployment issue I'd wager.
If you want us to help you further you're going to need to provide us some code such as how you're delete action is defined, the auth setup, the client code calling the API and any pertinent information about how your app and IIS are configured for authentication.
4 people are following this question.