asp net core return unauthorized with message code example
Example: asp.net throw unauthorized exception
throw new HttpResponseException(HttpStatusCode.Unauthorized);
throw new HttpResponseException(HttpStatusCode.Unauthorized);