There's no convenience method for no-content
result because, by default, when a action returns void
, the response will have the HTTP status 204.
If you wish to explicitly indicate that on the action, you could also return a StatusCode(HttpStatusCode.NoContent)
from your action or a
ResponseMessage(new HttpResponseMessage(HttpStatusCode.NoContent)).
The Unauthorized() convenience method gives you a 401 status so, for Forbidden (403), you would also have to use StatusCode(HttpStatusCode.Forbidden)
or
ResponseMessage(new HttpResponseMessage(HttpStatusCode.Forbidden))
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…