The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
ApiController.BadRequest Method
Namespace:
System.Web.Http
Assembly: System.Web.Http (in System.Web.Http.dll)
| Name | Description | |
|---|---|---|
![]() | BadRequest() | Creates a BadRequestResult. |
![]() | BadRequest(ModelStateDictionary) | Creates an InvalidModelStateResult with the specified model state. |
![]() | BadRequest(String) | Creates an T:System.Web.Http.Results.ErrorMessageResult (400 Bad Request) with the specified error message. |
ApiController.BadRequest Method (ModelStateDictionary)
Creates an InvalidModelStateResult with the specified model state.
protected internal virtual InvalidModelStateResult BadRequest( ModelStateDictionary modelState )
Parameters
- modelState
-
Type:
System.Web.Http.ModelBinding.ModelStateDictionary
The model state to include in the error.
Return Value
Type: System.Web.Http.Results.InvalidModelStateResultAn InvalidModelStateResult with the specified model state.
ApiController.BadRequest Method (String)
Creates an T:System.Web.Http.Results.ErrorMessageResult (400 Bad Request) with the specified error message.
Parameters
- message
-
Type:
System.String
The user-visible error message.
Return Value
Type: System.Web.Http.Results.BadRequestErrorMessageResultAn InvalidModelStateResult with the specified model state.
Show:
