Search...
response( )
Returns a response populated with the information from the options parameter.
The response()
function creates a custom response built with the
information passed to the options
parameter in a WixHttpFunctionCustomResponseOptions
object.
Use the response()
function to create a response to return from an HTTP
function.
Syntax
function response(options: WixHttpFunctionCustomResponseOptions): WixHttpFunctionResponse
response Parameters
NAME
TYPE
DESCRIPTION
options
WixHttpFunctionCustomResponseOptions
The response options.
Returns
Return Type:
Was this helpful?
Create a response
Copy Code
1// In http-functions.js23import {response} from 'wix-http-functions';45export function use_myFunction(request) {67 return response();8}
Create a response
Copy Code
1// In http-functions.js23import {response} from 'wix-http-functions';45export function use_myFunction(request) {67 let options = {8 status: 418,9 body: {10 "key1": "value1",11 "key2": "value2"12 },13 headers: {14 "Content-Type": "application/json"15 }16 };1718 return response(options);19}