A function that responds to requests made with the HTTP DELETE method.
The HTTP DELETE method is usually called by consumers to delete an existing resource. If defined in this way and the resource is deleted, the function should respond with a 200 (OK) status code.
Respond to the request by returning a WixHttpFunctionResponse
object you create using one of the response()
, ok()
,
created()
, notFound()
,
serverError()
, badRequest()
,
or forbidden()
functions.
The delete()
function is not a function that you call from your code. You define
the function in a file named http-functions.js in your site's Backend section.
The function is called when your users make HTTP requests using the associated
URLs as described below.
All DELETE requests with the following URL will be routed to this function:
Premium sites:
Free sites:
Notes:
"Content-Type": "application/json"
.
If the request breaks this syntax and includes either of these,
the function returns a 400 (Bad Request) status code.
The request object.