![]() ![]() ![]() ![]() ![]() ![]() ![]() |
|||||
|
|
|||||
| function | HttpResponseOutput | ||||
| Related Syntax | Related Concepts | Other Library Functions |
|
Library: HTTP
Include: omtcp.xin, omhttp.xin |
define function HttpResponseOutput
modifiable stream Response
This function formats the contents of a response object as a valid HTTP-formatted message and writes the entire text message to the current output. It is generally located in a server program and is used by the HttpConnectionSendResponse function.
Argument:
Example:
define function ServiceMain
( read-only stream requestHeader,
read-only stream requestBody
)
as
; local variables
local HTTPResponse this-response
; set the message body
open this-response^'entity-body' as buffer
using output as this-response^'entity-body'
do
output '<html><head><title>OmniMark Service</title></head>'
output '<body><h1>Welcome</h1>'
output 'This site is still under construction.'
output '</body></html>'
done
close this-response^'entity-body'
; send Response
HttpResponseOutput this-response
| ---- |