Forum Discussion
NicoB
Lithium Alumni (Retired)
Hi Gursimrat
I haven't tried it myself to be honest but looking at some internal documentation it seems that you're right, ?eval should parse a JSON string into a FTL hashmap.
You should be doing something like this:
<#assign search_query = http.request.parameters.name.get("search_query","optimizely") /> <#assign response = http.client.request("http://community/collection1/select?q=${search_query}&wt=json&indent=true").get()/> <#if response.hasError> ${response.error.message} <#else> <#assign theHash = ${response.content?eval} ${theHash.response.docs[0].summary} </#if>
Please let me know if this works.
Thanks,
Nico
Related Content
- 10 years ago
- 6 years ago