Contents SAS/IntrNet 8.2: Application Dispatcher Previous Next

APPSRV_HEADER


The DATA step function used to add or modify a header

Syntax
Arguments
Details
Examples


Syntax

OLD-HEADER = APPSRV_HEADER(Header Name,Header Value);


Arguments

Header name
The name of the header to set or reset.

Header Value
The new value for the header.

Details

Beginning with Version 8.1 of the Application Server, the APPSRV_HEADER function allows automatic header generation. You can add a header to the default list or modify a header that already appears in the list. When you modify the value of a header which already exists, the old value is returned as the return value of the function.

Starting with Release 8.2, the automatic HTTP header generation feature recognizes some of the Output Delivery System (ODS) output types and generates appropriate default content-type headers. Supported output types include HTML, GIF, JPEG, PDF, and POSTSCRIPT. An appropriate content type must be manually set with APPSRV_HEADER for all other output types. If no content type is specified with APPSRV_HEADER and no HTTP header is written to _WEBOUT, a default Content-type: text/html header is generated.


Examples

SAS Statements Resulting Headers
No calls to appsrv_header 
Content-type: text/html
/* add expires header */
rc = appsrv_header('Expires','Thu, 18 Nov 1999 12:23:34 GMT');
Content-type: text/html 
Expires: Thu, 18 Nov 1999 12:23:34 GMT
/* add expires header */
rc = appsrv_header('Expires','Thu, 18 Nov 1999 12:23:34 GMT');
/* add pragma header*/
rc = appsrv_header('Cache-control','no-cache');
Content-type: text/html
Expires: Thu, 18 Nov 1999 12:23:34 GMT
Cache-control: no-cache
/* add expires header */
rc = appsrv_header('Expires','Thu, 18 Nov 1999 12:23:34 GMT');
/* add pragma header*/
rc = appsrv_header('Cache-control','no-cache');
...
/* remove expires header, rc contains old value */
rc = appsrv_header('Expires','');
Content-type: text/html
Cache-control: no-cache

Disabling Automatic Header Generation

To completely disable Automatic Header Generation for a request, call the APPSRVSET DATA step function, as so:

   data _NULL_;
      rc = appsrvset("automatic headers", 0);
   run;

Contents SAS/IntrNet 8.2: Application Dispatcher Previous Next