Syntax:
SEND [TYPE content-type] [BINARY|TEXT] [AS name] SEND COMPLETE [NOWAIT]
SEND and SEND COMPLETE are used to start and end a response which is composed of more than one piece of data. The response is started by the SEND command (without the COMPLETE keyword) and, if using HTTP, the HTTP header is sent at that point.
After a SEND command, the completion commands (FILE, VAR, STRING, etc.) no longer cause the response to be completed, nor do they have any HTML wrapper or HTTP header, etc., added. Instead, the plain data generated by the command (or the response to CLOSE or CONTROL, or nothing for NODATA) is sent to the client.
Following any data commands, SEND COMPLETE is used to indicate that the response is complete, and will write a 'C' audit line if the appropriate auditing is in effect (see "The audit mechanism"). The NOWAIT keyword may be used on SEND COMPLETE to force the current connection to be closed after any response is sent, even if a persistent connection had been requested.
SET NETBUFFER can be used to control whether data are buffered (collected into packets) before being sent or are sent immediately. NETBUFFER is ON by default.
The optional keywords on the SEND command to start the response may be specified in any order, and have the following effects:
The TYPE option may only be used if GoServe is started with the HTTP parameter (HTTP headers are not used by Gopher), and should normally always be used when running as a Web server.
Here is an example of returning an HTML document to a Web client, including a file in the middle.
/* This is Rexx code */ 'send type text/html as MultiDoc' 'string <!doctype html public "-//IETF//DTD HTML 2.0//EN">' 'string <html><head><title>Multiple...</title></head>' 'string <body><h2>Here is a test file:</h2><hr>' 'file name test.dat' 'string <hr></body></html>' 'send complete' /* complete and audit the send */
See GOFILTER.80 for an example of a more dynamic document, in the DOPUSH function.
Notes:
[ previous section | contents | next section ]
From 'goserve.doc', version 2.52.
Copyright © IBM Corporation, 1993, 1998. All rights reserved.