Home > Class Reference > ENSLIB namespace > %CSP.Response


class %CSP.Response extends %Library.RegisteredObject

The %CSP.Response class determines what the HTTP headers generated for this page will look like. Note that by default CSP pages are set to never be cached, so the browser will have to get the page each time. If you wish to change this see the Expires property.

Property Inventory (Including Private)

Method Inventory (Including Private)

Properties (Including Private)

property AllowOutputFlush as %Integer [ InitialExpression = 0 ];
This flag is intended to be used in conjunction with the Flush() method. The Flush() method will flush the response output buffer from Caché to the CSP Gateway. If this flag is set in the page OnPreHTTP() method, the Gateway will flush each buffer received from Caché to the web server, without attempting to aggregate small buffers into larger ones before final dispatch back to the web server.

<script language="Cache" method="OnPreHTTP" arguments="" returntype="%Boolean">
: Set %response.AllowOutputFlush=1
: Quit 1
Property methods: AllowOutputFlushDisplayToLogical(), AllowOutputFlushGet(), AllowOutputFlushIsValid(), AllowOutputFlushLogicalToDisplay(), AllowOutputFlushNormalize(), AllowOutputFlushSet()
property CharSet as %String;
Sets the Character Set for the content-type header. If CharSet is '= "" and NoCharSetConvert=0, then output is translated for any content-type. If not specified for text, then default is utf-8 on Unicode systems and the system default on 8-bit systems.
Property methods: CharSetDisplayToLogical(), CharSetGet(), CharSetIsValid(), CharSetLogicalToDisplay(), CharSetLogicalToOdbc(), CharSetNormalize(), CharSetSet()
property ContentLength as %String;
Sets the Content-Length header. Since the HTTP headers are sent after the OnPreHTTP() method is complete, setting it after this has no effect.
Property methods: ContentLengthDisplayToLogical(), ContentLengthGet(), ContentLengthIsValid(), ContentLengthLogicalToDisplay(), ContentLengthLogicalToOdbc(), ContentLengthNormalize(), ContentLengthSet()
property ContentType as %String [ InitialExpression = "text/html" ];
Sets the Content-Type header. Since the HTTP headers are sent after the OnPreHTTP() method is complete, setting it after this has no effect.
Property methods: ContentTypeDisplayToLogical(), ContentTypeGet(), ContentTypeIsValid(), ContentTypeLogicalToDisplay(), ContentTypeLogicalToOdbc(), ContentTypeNormalize(), ContentTypeSet()
property Context as %String [ MultiDimensional ];
Maintain a list of name-value pairs that will be added to every hyperlink and form on this page. This array should be created in the OnPreHTTP() method before the page is being rendered or some links will have these parameters and some will not. This can be used for example to add a page Id to every link from this page so that if the user bookmarks this page and comes back to it later you will know they clicked on a link from the 'Camera purchase' page of the web site.

The format of this array is just:

  Set %response.Context("Name")="Value"
Note that if the page you link to is encoded then these parameters will be automatically encrypted, if you do not want this behavior then 'Set %response.Context("Name","encrypted")=0' in addition to setting the value of this property. If you wish to insert the same item name multiple times you can do this.

  Set %response.Context("Name")="Value"
  Set %response.Context("Name",1)="Value2"
This will insert 'Name' twice, first with 'Value' and then with 'Value2'.
Property methods: ContextDisplayToLogical(), ContextGet(), ContextIsValid(), ContextLogicalToDisplay(), ContextLogicalToOdbc(), ContextNormalize(), ContextSet()
property CookiePath as %String (MAXLEN = 256);
The path we will send the session cookie with
Property methods: CookiePathDisplayToLogical(), CookiePathGet(), CookiePathIsValid(), CookiePathLogicalToDisplay(), CookiePathLogicalToOdbc(), CookiePathNormalize(), CookiePathSet()
property Cookies as %String [ MultiDimensional ];
Maintains the collection of cookies to be sent out. See SetCookie().
Property methods: CookiesDisplayToLogical(), CookiesGet(), CookiesIsValid(), CookiesLogicalToDisplay(), CookiesLogicalToOdbc(), CookiesNormalize(), CookiesSet()
property Domain as %String;
The %response.Domain attribute is used as the default domain for csp:text, span and div tags. The %response.Domain attribute is initialized from the DOMAIN parameter of the CSP and may be changed by the page class at any time.
Property methods: DomainDisplayToLogical(), DomainGet(), DomainIsValid(), DomainLogicalToDisplay(), DomainLogicalToOdbc(), DomainNormalize(), DomainSet()
property Expires as %String [ Calculated ];
Used to control the expiration of the CSP page being served. It can be set to one of the following values:
  • -1: Expire immediately, this is the default for a CSP page
  • 0: Expire immediately, this also sets the 'no-store' option so using the back button will request a new page
  • "": No HTTP 'Expires', 'Pragma', or 'cache-control' headers are sent.
  • nnnnn: Number of seconds from now when the object should expire
  • Thu, 29 Oct 1998 17:04:19 GMT: Absolute time at which the object should expire
  • One way to 'never expire' is to set a 'forever date':
  • "Sun, 17-Jan-2038 19:14:07 GMT" is the maximum 32-bit Unix time/date
  • "Mon, 31 Dec 2035 12:00:00 GMT" is the maximum IIS6 date.
  • ddddd,sssss: Absolute time the object should expire in $ZTimeStamp format. Note that this must be specified in the GMT timezone
Note that setting this header also effects the 'Cache-Control' and 'Pragma' headers. If the page is set to expire immediately then it will send a 'Cache-Control: no-cache' and 'Pragma: no-cache' to prevent any caches from storing the page. If the page is set to never expires then it will not send any 'Cache-Control' or 'Pragma' headers. If you set an expires date then it will not modify the 'Cache-Control' or 'Pragma' headers so if they are set they will be sent as specified and if you did not set them then nothing will be sent for these headers.
Property methods: ExpiresDisplayToLogical(), ExpiresGet(), ExpiresIsValid(), ExpiresLogicalToDisplay(), ExpiresLogicalToOdbc(), ExpiresNormalize(), ExpiresSet()
property GzipOutput as %Boolean;
If true the ask the CSP gateway to gzip the output and add modify the HTTP header to show the data is gzipped. Depending on the version and platform of the CSP gateway component this may not be supported in which case the output will be sent as per normal.
Property methods: GzipOutputDisplayToLogical(), GzipOutputGet(), GzipOutputIsValid(), GzipOutputLogicalToDisplay(), GzipOutputNormalize(), GzipOutputSet()
property HTTPVersion as %String;
Version of HTTP support CSP will report. If this is "" (the default) then use the version reported from the client request. If you need another value such as '1.0' to report 'HTTP/1.0' even for a HTTP/1.1 request then set this property to the version on you require.
Property methods: HTTPVersionDisplayToLogical(), HTTPVersionGet(), HTTPVersionIsValid(), HTTPVersionLogicalToDisplay(), HTTPVersionLogicalToOdbc(), HTTPVersionNormalize(), HTTPVersionSet()
property HeaderCharSet as %String;
Sets the Character Set to write out the HTTP headers. If not specified it defaults to UTF-8 which appears to be the standard for most browsers. If you do not want to use any translation you can specify "RAW" for this property.
Property methods: HeaderCharSetDisplayToLogical(), HeaderCharSetGet(), HeaderCharSetIsValid(), HeaderCharSetLogicalToDisplay(), HeaderCharSetLogicalToOdbc(), HeaderCharSetNormalize(), HeaderCharSetSet()
property Headers as %String [ MultiDimensional ];
Maintains the collection of additional HTTP Headers to be sent out. See SetHeader() and GetHeader().
Property methods: HeadersDisplayToLogical(), HeadersGet(), HeadersIsValid(), HeadersLogicalToDisplay(), HeadersLogicalToOdbc(), HeadersNormalize(), HeadersSet()
property InProgress as %Integer [ InitialExpression = 0 ];
Returns true if the request is already in progress -- that is the HTTP headers have been sent, and false otherwise. A read only property.
Property methods: InProgressDisplayToLogical(), InProgressGet(), InProgressIsValid(), InProgressLogicalToDisplay(), InProgressNormalize(), InProgressSet()
property Language as %String;