created( )


Returns a response with status code 201 (Created) and the information from the options parameter.

The created() function creates a response with the status code 201 (Created).

Optionally, the created() 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 created() function to create a response to return from an HTTP function. A 201 (Created) response is usually used to indicate that the request was successful and a new resource has been created.

Method Declaration
Copy
function created(
  options: WixHttpFunctionResponseOptions,
): WixHttpFunctionResponse;
Method Parameters
optionsWixHttpFunctionResponseOptions

The response options.

Returns
Return Type:WixHttpFunctionResponse
JavaScript
// In http-functions.js import { created } from "wix-http-functions"; export function use_myFunction(request) { return created(); }
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?