<%& '/header/' %>

External Resources

In this example we'll access an external JSON document and display it on the page. We'll do a simple GET, though all HTTP verbs are supported.

The default URL provided is for a static JSON resource served by this application, but you can, of course, use any resource on the Internet.


<% if (conversation.request.method.name == 'POST') { var url = conversation.form.get('url') var resource = document.external(url, 'application/json') var text try { text = resource.get().text } finally { resource.response.release() } %>

The resource is:

<%= text %>
<% } else { %>

Enter the URL of a JSON resource:

<% } %> <%& '/footer/' %>