That is actually a very good point. I'll go the macro route (hardly ever use those..oO)
If you're interested:
When I load my endpoint, the html looks like this:
<html><head></head><body>70</body></html>
When I run my ajax I get back 70.
But if I try FM:
<#assign test = http.client.request("/spotify/plugins/custom/spotify/spotify/endpoint_test")/>
${test}
I get this:
FreeMarker template error (HTML_DEBUG mode; use RETHROW in production!)
An error has occurred when reading existing sub-variable "client"; see cause exception! The type of the containing value was: extended_hash+string (lithium.coreapi.webui.template.models.HttpTemplateModel wrapped into f.e.b.StringModel)
----
FTL stack trace ("~" means nesting-related):
- Failed at: #assign test = http.client.request("/... [in template "StringDisplay" at line 1, column 1]I tried different suffixes like .get().content and such, but since the issue seems to be with the "client" part, that couldn't be the problem.
Anyway, thanks for the feedback!