Body Method

AFP collects all data to be sent back to the browser in a buffer. This buffer is limited to the maximum length of a character string in Visual FoxPro – at the time of this writing just under 16 MB. Through Response.Body() the current content of this buffer is returned.

Syntax

cResponseBuffer = Response.Body()

Return value

All output to the response buffer up to that point in time will be returned as character string. If after the invocation of Response.Body() no further output is effected, the return value will correspond to the page displayed by the client browser. In case the AFP document returns XML data for an application rather than HTML data for a browser, Response.Body() will contain the XML data to be returned to the application.

<HTML>

<HEAD>

  <TITLE>Example: Response.Body()</TITLE>

<HEAD>

 

<BODY>

  Response buffer:

  <p><% ? Response.Body() %></p>

<BODY>

<HTML>

Generally, Response.Body() is only used at the end of a page. With the aid of Response.Body() in the event EVENT_PageAfter you can send all URLs through Session.Url() a second time and swap the response buffer through Response.Clear() and Response.BinaryWrite(). In this fashion, there is no need for you to remember that you should call Session.Url() at each and every combination.

See also

Response.Clear()