Forum Discussion
NicoB
11 years agoLithium Alumni (Retired)
Hi Gursimrat
the right call should be
<#assign response = http.client.request("http://community/collection1/select?q=${search_query}&wt=json&indent=true").json().get()
Thanks,
Nico
- NicoB11 years agoLithium Alumni (Retired)Hi Gursimrat,
just to clean up any ambiguity:
1. Is http.client enabled on your instance?
2. Is the URL you're trying to invoke whitelisted in the http client admin screen ?- Gursimrat11 years agoLeader
I think the issue is that I have to use ?eval to convert it into ftl hash, but when I try using ?eval, it is still giving an error.
Can you suggest, where do I put ?eval so that I can iterate through the FTL hash using list
<#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").json()/>
<#if response.hasError>
${response.error.message}
<#else>
${response.content}
</#if>
Related Content
- 11 years ago
- 7 years ago