Description
Sets the custom responses.
History
ColdFusion 10: Added this function
restSetResponse(response)
Parameter |
Description |
---|---|
response |
A struct that contains the response details. |
Note: ColdFusion ignores the function's return value and uses the response set using the RestSetResponse() function. |
<cffunction name="create" httpMethod="POST" produces="application/xml"> <cfargument name="id" type="numeric"> <cfargument name="name" type="String"> <cfset var response={ status=201, content="<customer id="&id&"><name>"&name&"</name></customer>">, headers={ location="http://localhost:8500/rest/CustomerService/customers/123", } }> <cfset restSetResponse(response)> <cffunction>