I'm working in ICIMS API. I need to return JSON data and some specific data in header in a cfm page call by ICIMS server.
Here is the response should be:
Response to the Work Flow Status Change PUSH event to the platform:
HTTP/1.1 303 See Other
Location: http://xx.xx.xx.xx:8085/selectpackage?systemHash=101
Content-Type: application/json
{
"userMessage":"Confirm or modify package.",
}
Thanks in advance.
Answer:
> <cfset contentString = '{"userMessage": "Confirm or modify package."}'
> />
>
> <cfheader name="Location"
> value="http://xx.xx.xx.xx:8085/selectpackage?systemHash=101" />
> <cfcontent type="application/json" variable="#toBinary( toBase64( contentString ) )#" />
<cfheader
statusCode = "303"
statusText = "See Other">
<cfheader
name="Location"
value="http://xx.xx.xx.xx:8085/selectpackage?systemHash=101">
<cfheader
name="Content-Type"
value="application/json">
<cfset foo = structNew()>
<cfset foo["userMessage"] = "Confirm or modify package.">
<cfoutput>#serializeJSON(foo)#</cfoutput>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With