Show TOC

Accessing HTTP Body DataLocate this document in the navigation structure

Use

In some cases, a HTTP request handler needs to access the unprocessed data in the HTTP body. This may be the case if the content type is 'text/html' or 'text/xml', and the HTTP body contains no form fields.

The following methods can be used for this purpose:

  • GET_DATA()[Returns the HTTP body of this entity as binary data]

  • GET_CDATA()[Returns the HTTP body of this entity as character data]

.

The methods

  • SET_DATA()[sets the HTTP body of this entity to the given binary data]

  • SET_CDATA()[sets the HTTP body of this entity to the given character data]

The following methods allow you to modify the request data, if necessary.

Features

While the method

  • APPEND_CDATA()[inserts character data in the HTTP body of this entity]

always work with raw data, method

  • APPEND_CDATA2[inserts character data in the HTTP body of this entity]

contains an extra parameter that indicates which coding the data is in.

This parameter can take the following values:

  • CO_ENCODING_RAW

  • CO_ENCODING_URL

  • CO_ENCODING_HTML

  • CO_ENCODING_WML

These values indicate how the text should appear. The text is usually displayed as it was entered ( CO_ENCODING_RAW). If, however, it appears in a URL (for example, as a parameter), it must have a specific coding (for example, blank characters are replaced by '+' or '%20'). In this case, parameter CO_ENCODING_URL is used. If you want a text to appear on an HTML page as it was entered, any characters that have special semantics in HTML (such as '<' ) must be replaced by their HTML-encoded counterpart ( '&lt' ) ( CO_ENCODING_HTML). The constant CO_ENCODING_WML is available for the WML coding for WML.

Note

This coding is mainly used in BSP pages by expressions such as ' <% html= mystring %>' with the values html, url, and raw. The WML coding is executed if html is specified as coding, but the page has the MIME type of a WML document.

More Information

For a detailed description of the request data, see:

Process