ApiController.StatusCode(HttpStatusCode) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Creates a StatusCodeResult with the specified status code.
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.StatusCodeResult StatusCode (System.Net.HttpStatusCode status);
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member StatusCode : System.Net.HttpStatusCode -> Microsoft.AspNetCore.Mvc.StatusCodeResult
override this.StatusCode : System.Net.HttpStatusCode -> Microsoft.AspNetCore.Mvc.StatusCodeResult
Public Overridable Function StatusCode (status As HttpStatusCode) As StatusCodeResult
Parameters
- status
- HttpStatusCode
The HTTP status code for the response message
Returns
A StatusCodeResult with the specified status code.
- Attributes