Information
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)

NameDescription
System_CAPS_protmethodBadRequest()

Creates a BadRequestResult.

System_CAPS_protmethodBadRequest(ModelStateDictionary)

Creates an InvalidModelStateResult with the specified model state.

System_CAPS_protmethodBadRequest(String)

Creates an T:System.Web.Http.Results.ErrorMessageResult (400 Bad Request) with the specified error message.

Return to top

ApiController.BadRequest Method ()

Creates a BadRequestResult.

protected internal virtual BadRequestResult BadRequest()
Return to top

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.InvalidModelStateResult

An InvalidModelStateResult with the specified model state.

Return to top

ApiController.BadRequest Method (String)

Creates an T:System.Web.Http.Results.ErrorMessageResult (400 Bad Request) with the specified error message.

protected internal virtual BadRequestErrorMessageResult BadRequest(
	string message
)

Parameters

message
Type: System.String

The user-visible error message.

Return Value

Type: System.Web.Http.Results.BadRequestErrorMessageResult

An InvalidModelStateResult with the specified model state.

Return to top
Show: