body. Specifying a new response body


DATA substitutes for the whole response body.

DATA may be a string, file or hash of parameters.

Keys of hash of parameters: [3.1.4]
file - name of file on disk (in this case Parser supports continuing of broken downloads. [3.1.4]);
name - name of file to pass to visitor;
- date and time of file last modification to pass to visitor.

content-type of sent file is known, Content-Type header is also output to the browser (see "Fields of object of class file").

See also

Example of how to replace the whole body of the response with the results of the script's work

…will replace the body of the response with the data returned by the program

Example of how to create and output an image

As a result, the browser will output a black square with a white circle. Besides, a necessary type of file (content-type) according to table
MIME-TYPES will be reported to the browser.

Copyright © 1997–2021 Art. Lebedev Studio | Last updated: 20.09.2007