ColdBox 4 introduces yet more nifty tools for RESTFul web services. In ColdBox 4, we introduced the capability to do auto-marshaling of RESTFul body content from either JSON or XML formats. We will take care of the defaults, nulls and incompatibility requirements. All you have to do is use our event.getHTTPContent()
method and pass the appropriate conversion argument.
The possible conversion boolean arguments are:
- json
- xml
If set, ColdBox will auto-marshall the HTTP Body content from JSON or XML to native ColdFusion data types.
myStruct = event.getHTTPContent( json=true ); xmlObject = event.getHTTPContent( xml=true );
Add Your Comment