badRequest( )


Returns a response with status code 400 (Bad Request) and the information from the options parameter.

The badRequest() function creates a response with the status code 400 (Bad Request).

Optionally, the badRequest() function can take a WixHttpFunctionResponseOptions object which is used to specify the response's body and headers.

Note: If the object contains a status it will be ignored.

Use the badRequest() function to create a response to return from an HTTP function. A 400 (Bad Request) response is usually used to indicate the request was unsuccessful because of a client error, such as a request using the incorrect syntax.

Method Declaration
Copy
Method Parameters
optionsWixHttpFunctionResponseOptions

The response options.

Returns
Return Type:WixHttpFunctionResponse
Did this help?