WARNING: The [sjs-3] engine was deprecated, use [sjs-4] instead.

os.print()

Write to the response body.

Syntax

os.print(str string)

Parameters

str string

Contents to print to the resposne body.

Description

Write to the end of the response body.

Note that the current implementation of os.print() writes to the response body immediately, but future implementations may write to a buffer first and only flush that buffer once the transaction finished execution. Thus, you must not rely on os.print() to write the response body immediately. Either use os.print() or response.body() but do not mix using both.

Examples

os.print() appends to the response body.

response.body() sets the response body in contrast to os.print() appending to it.