SAS/IntrNet 9.1: Application Dispatcher |
The DATA step function used to add or modify a header
Syntax
Arguments
Details
Examples
OLD-HEADER = APPSRV_HEADER(Header Name,Header Value);
The APPSRV_HEADER function enables automatic header generation. You can add a header to the default list or modify an existing header from the list. When you modify the value of an existing header, the old value becomes the return value of the function.
The automatic HTTP header generation feature recognizes Output Delivery System (ODS) output types and generates appropriate default content-type headers. If no content type is specified with APPSRV_HEADER, ODS is not used and no HTTP header is written to _WEBOUT, a default Content-type: text/html
header is generated.
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 |
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;
SAS/IntrNet 9.1: Application Dispatcher |