If a user is not authorized to access a specific action, what default HTTP status code does ASP.NET Core return?
- 200 OK
- 403 Forbidden
- 401 Unauthorized
- 404 Not Found
When a user is not authorized to access a specific action, ASP.NET Core returns a default HTTP status code of 401 Unauthorized. This status code indicates that the request lacks proper authentication credentials or the provided credentials are invalid for the requested resource. It's a fundamental part of the authentication and authorization process in web applications.
Loading...
Related Quiz
- Continuous _________ is a software development practice where changes in the code are automatically tested and prepared for a release to production.
- You're trying to create a basic form in a Razor view to capture user feedback. Which tag helper would you use to create a textbox for users to type in their comments?
- In ASP.NET Core, if you want to serve static files like images, CSS, and JavaScript, you need to add the _________ middleware.
- What is the primary role of the .NET SDK in the context of ASP.NET Core development?
- When a user submits a form in Razor, the data is usually sent to a/an _________ method in a controller.