|
The SWSRESP FunctionRelated Topics
SWSRESP is a high level function used to buffer customized outbound HTTP response headers for subsequent transmission to Web client browsers. SWSRESP may be used to buffer an HTTP response header at any time during the life of a Web transaction. Using SWSRESP to buffer HTTP response headers differs from merely writing these headers using SWSSEND:
The Server merges the HTTP response headers which have been buffered using SWSRESP with any other data generated by the Web transaction. This merge processing takes place when the Web transaction ends and causes the complete output stream to be assembled and transmitted to the client. SWSRESP is only valid when a Web transaction procedure is operating in server-parsed header mode since the merging/assembly, described above, is disabled in non-parsed-header mode. A call to SWSRESP will return an error if the Web transaction is not operating in server-parsed header mode.
SWSRESP SyntaxThe SWSRESP function takes three arguments. The invocation format for SWSRESP is: Z = SWSRESP( func, hname, hvalue )
Return ValuesSWSRESP always returns a numeric value. A zero return value indicates successful buffering (though not actual transmission) of the HTTP response header. A non-zero return value indicates that an error has occurred. The SWSRESP operation is not logged to the Server's wrap-around trace file unless an error occurs. If you need to trace information actually sent as a result of an SWSRESP request, use the SENDTRACE keyword of the /*WWW rule header.
ExampleThe following call will cause two HTTP response headers to be merged with other headers generated by SWSFILE. A "Pragma: no-cache" and "Expires: Mon, 14 APR 1998 12:02:03 GMT" HTTP response header will be included in the final output transmission stream.
|