Serializes the object to a specified type



Function syntax

serialize( Object object, String type, boolean useCustomSerializer )


ColdFusion (2018 release): Introduced named parameters.

ColdFusion 11: Added this function. 





Required. An object to be serialized.

type A type to which the object will be serialized. ColdFusion, by default supports XML and JSON formats. You can also implement support for other types in the CustomSerializer CFC.
useCustomSerializer Boolean. Whether to use the custom serializer or not. The default value is true. The custom serializer will be always used for XML deserialization. If false, the XML/JSON deserialization will be done using the default ColdFusion behavior. If any other type is passed with useCustomSerializer as false, then TypeNotSupportedException will be thrown.

For more information see REST Enhancements in ColdFusion 11.

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