Description

Sets the custom responses.

History

ColdFusion 10: Added this function

Syntax

restSetResponse(response)

Parameters

Parameter

Description

response

A struct that contains the response details.

Warning

Note: ColdFusion ignores the function's return value and uses the response set using the RestSetResponse() function.

Example

<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>

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy