RestSetResponse()
Sets the custom responses.
RestSetResponse( response=struct );
Returns: void
Argument | Description |
---|---|
response
struct,
required
|
A struct that contains the response details. Alias: rsp |
Examples
RestSetResponse(
{
"status":"200",
"content":"[]",
"headers":{"Content-Type": "application/javascript"}
}
);
RestSetResponse(
{
"status":"201",
"headers":{
"Location": "/rest/api/thisResource/001",
"Content-Location": "/rest/api/thisResource/001"
}
}
);
RestSetResponse(
{
"status":"404",
"content":"This resource does not exist"
}
);
See also
- Ajax features
- Ajax features
- RestDeleteApplication()
- RestInitApplication()
- REST Services: Introduction
- Search Issue Tracker
- Search Lucee Test Cases (good for further, detailed examples)