Write method: Response class

Syntax

Write(String)

Description

This method prints String to the HTTP output stream.

If you want the input content to be displayed as is, that is, you do not want the content to be minified, then you must set the type parameter to “text/html” in the SetContentType method.

You can use an HTML string from Application Designer HTML catalog with the Write method if you also use the GetHTMLText function, as follows:

%Response.Write(GetHTMLTEXT(HTML.MY_HTML));

You can also use an XML string. The following example takes a BiDocs structure that contains an XML response and puts that into a text string. After this is done, the %Response.Write function can send this as an XML response.

Local BIDocs &rootDoc; 
Local string &xmlString; 
&xmlString = %Response.GetContentBody(); 
&rootDoc = GetBIDoc(&xmlString); 
/* do processing */ 
&xmlString = &rootDoc.GenXMLString(); 
%Response.Write(&xmlString);