Embed with Json CustomRequestBody Example

In this example, a page that handles a Json request and returns a Json result is embedded.

This demo application page to be embedded has the following SXML logic:

Smartsite SXML CopyCode image Copy Code
<se:json />
<se:json localid="response">{}</se:json>
{scope.response.set("result", string.toupper($t), string)}
{page.setforcedresult(scope.response.get(), "application/json")}

Smartsite SXML CopyCode image Copy Code
<se:embed location="JSONDEMOPAGE01" save="responseJson">
        <se:parameter name="customrequestbody">
            {data: {
                title: "Hello world"
        <se:parameter name="customrequestcontenttype">application/json</se:parameter>        

<se:json localid="response">{buffer.get(responseJson)}</se:json>
Example Result CopyCode image Copy Code