Usage count: 1
This script provides a simple demonstration of the CGIplus callout facility, used to suspend normal script output and communicate directly with the server. This allows the script to request information from the server, or set certain script operating parameters, etc.
To begin an callout the CGIPLUSESC environment variable (logical name) is output as a record. For this script it has a value of:
$E-3B859583081360E8D45861C9-
(but of course is not static, and varies each time the script is first executed).
A single-record script request followed by a single-record server response dialog may then be engaged in.
To end an callout the CGIPLUSEOT environment variable (logical name) is output as a record. For this script it has a value of:
$D-2A7F2D5CAA80FEAD14E7B98A-
(and also will vary each time the script is first executed).
Normal script output (to the browser) is then resumed. When in callout mode one or more request/responses may be made. Normal and callout output may be interleaved during a script response, as this script illustrates.
Example Behaviour
/wasd_root/src/httpd/
The request sent to the server was:
MAP-PATH: /wasd_root/src/httpd/
The full server response was:
200 wasd_root:[src.httpd]
Yielding a file specification of:
wasd_root:[src.httpd]
WASD_ROOT:[SRC.HTTPD]
The request sent to the server was:
MAP-FILE: WASD_ROOT:[SRC.HTTPD]
The full server response was:
200
Yielding a path of:
The request sent to the server was:
UNKNOWN?: WASD_ROOT:[SRC.HTTPD]
The full server response was:
400 Unknown request
Success responses begin with an HTTP-like "200", other responses with appropriate status codes.