Learning
Documentation
Community
Open Exchange
Global Masters
Home / Class Reference / ENSLIB namespace / %CSP.Request
Private  Storage   

%CSP.Request


class %CSP.Request extends
%RegisteredObject

The %CSP.Request class encapsulates an incoming URL and its parameters.

When a csp request is received, the CSP Server creates an instance of the %CSP.Request class. This is accessible via the %request variable.

Inventory


Parameters Properties Methods Queries Indices ForeignKeys Triggers
37 52


Summary


Properties
AppData AppMatch Application CSPGatewayRequest
CgiEnvs CharSet Class Content
ContentType Cookies Data GatewayApplication
GatewayBuild GatewayConnectionName GatewayError GatewayFunctions
GatewayInstanceName GatewayNewId GatewaySessionCookie GatewaySessionIdSource
GatewayTimeout Method MimeData PageName
ProcessedRequestType Protocol RegistryMethods RequestId
Secure Service SoapAction URL
URLPrefix UserAgent WebSocketStatus

Methods
%%OIDGet %AddToSaveSet %BindExport %BuildObjectGraph
%ClassIsLatestVersion %ClassName %Close %ConstructClone
%DispatchClassMethod %DispatchGetModified %DispatchGetProperty %DispatchMethod
%DispatchSetModified %DispatchSetMultidimProperty %DispatchSetProperty %Extends
%GetParameter %IncrementCount %IsA %IsModified
%New %NormalizeObject %ObjectModified %OriginalNamespace
%PackageName %RemoveFromSaveSet %SerializeObject %SetModified
%ValidateObject CSPGatewayReset Count CountCookie
CountMimeData Decrypt Delete DeleteCgiEnv
DeleteCookie DeleteMimeData DetermineRequestType Find
Get GetCgiEnv GetCookie GetMimeData
Insert InsertCgiEnv InsertCookie InsertMimeData
IsDefined IsDefinedCgiEnv IsDefinedCookie IsDefinedMimeData
IsEncrypted Next NextCgiEnv NextCookie
NextIndex NextMimeData NextMimeDataIndex ProcessRequest
Reset Set UpdateURL


Properties


• property AppData as %String;
Store some CSP application specific internal data for this request
• property AppMatch as %String;
Store some CSP application specific internal data for this request
• property Application as %String;
The section of the Url that has been matched against a CSP application name.
• property CSPGatewayRequest as %Boolean [ InitialExpression = 0 ];
True if the request came the CSP Gateway, and false if it was from the command line or the built in web server.
• property CgiEnvs as %String [ MultiDimensional ];
An array of strings containing any environment values associated with this request. The format of this array is:
  • request.CgiEnvs(<NAME>)=<VALUE>
Where <NAME> is the name of the Cgi environment variable and <VALUE> is the value of this environment variable.

It is suggested that you use the accessor methods rather than set/get the value of this multidimentional property directly.
• property CharSet as %String;
Character set this request was send in, if not specified in the HTTP headers it defaults to the character set of the page it is being submitted to.
• property Class as %String;
Classname we are going to call
• property Content as %CSP.Stream;
A %CSP.Stream containing the content submitted with this request.
• property ContentType as %String;
A string indicating the MIME Content-Type of the request.
• property ConvertCharSet as %String [ Private ];
Internal character set to use to convert the input, will be the CharSet if specified in the HTTP headers, else we determine this from the page this is being dispatched to.
• property Cookies as %String [ MultiDimensional ];
An array of strings containing any cookie values associated with this request. The format of this array is:
  • request.Cookies(<NAME>,<INDEX>)=<VALUE>
Where <NAME> is the name of the cookie, <INDEX> is an index number starting at 1 as you may have multiple cookies with the same name so subsequent ones will be added with a higher index number. <VALUE> is the value of this cookie.

It is suggested that you use the accessor methods rather than set/get the value of this multidimentional property directly.
• property Data as %String [ MultiDimensional ];
An array of strings containing any parameter name/value pairs associated with this request. The format of this array is:
  • %request.Data(<NAME>,<INDEX>)=<VALUE>
  • %request.Data(<NAME>,<INDEX>,"encrypt")=<Encrypted state>
  • %request.Data(<NAME>,<INDEX>,"O")=<Order number item was added>
Where <NAME> is the name of the parameter, <INDEX> is an index number starting at 1 as you may have multiple parameters with the same name so subsequent ones will be added with a higher index number. <VALUE> is the value of this parameter. <Encrypted state> is 1 if the value of this parameter was encrpyted and 0 otherwise.
Note that it is faster to access this multidimensional property directly rather than going through the accessor methods. For example:
	; Set the index number one 'Name' to 'Value'
	Set %request.Data("Name",1)="Value"
	; Output the value of parameter 'Name' for index number one (the default)
	Write %request.Data("Name",1)
	; Insert a new value for parameter 'Name' to 'Value'
	Set %request.Data("Name",$Order(%request.Data("Name",""),-1)+1)="Value"
	; Test if parameter 'Name' at index 2 is encrypted
	If $Data(%request.Data("Name",2,"encrypt"))
• property GatewayApplication as %String;
The section of the Url that the CSP Gateway on the web server matched against to determine which Caché server to send the request to. If the Url was '/csp/samples/menu.csp' and the CSP Gateway is setup to match all requests to '/csp' then this parameter would be '/csp'.
• property GatewayBuild as %String;
The internal build version of the CSP Gateway talking to the server
• property GatewayConnectionName as %String;
The name of the connection in the CSP Gateway that this request was sent to.
• property GatewayError as %Status;
Internal property to hold CSP Gateway originated error codes
• property GatewayFunctions as %String;
Internal information on CSP Gateway functions
• property GatewayInstanceName as %String;
The instance host name of the Gateway that is communicating with this process
• property GatewayNewId as %Boolean [ InitialExpression = 0 ];
True if the sessionId is newly assigned by the Gateway, and false if it is provided by the browser
• property GatewaySessionCookie as %String;
The session cookie that the Gateway picked as the sessionId
• property GatewaySessionIdSource as %Integer;
How the gateway obtained the sessionId information.
  • 0 - Field not defined
  • 1 - New session generated by Gateway
  • 2 - CSPCHD in url/form
  • 3 - Browser cookie
  • 4 - SOAP payload
• property GatewayTimeout as %Integer [ InitialExpression = 60 ];
The value of the Server Response Timeout in the Gateway configuration.
• property Method as %String;
A string indicating HTTP method used for this request. Normally one of 'GET', 'POST', or 'HEAD'.
• property MimeData as %CacheString [ MultiDimensional ];
An array of streams containing any multipart/mime data associated with this request. The format of this array is:
  • request.MimeData(<NAME>,<INDEX>)=<VALUE>
Where <NAME> is the name of the mime data stream, <INDEX> is an index number starting at 1 as you may have multiple mime streams with the same name so subsequent ones will be added with a higher index number. <VALUE> is the Oref of the stream associated with this mime data.

It is suggested that you use the accessor methods rather than set/get the value of this multidimentional property directly.
• property PageName as %String;
A string containing the name of the CSP page being processed.
• property ProcessedRequestType as %Boolean [ InitialExpression = 0 ];
• property Protocol as %String [ InitialExpression = "HTTP/1.1" ];
HTTP protocol version of the browser request. Normally either 'HTTP/1.0' for older browsers and 'HTTP/1.1' for newer browsers.
• property RegistryMethods as %Integer [ InitialExpression = 1 ];
The status of Registry Methods [1:Enabled; 0:Disabled]
• property RequestId as %String;
The Gatewway Request Id
• property Secure as %Boolean [ InitialExpression = 0 ];
True if the communication between the browser and the web server was using the secure https protocol. False for a normal http connection.
• property Service as %String [ InitialExpression = "CSP" ];
Type of request we have
• property SoapAction as %String [ MultiDimensional ];
• property URL as %String;
A string containing the URL up to and including the page name and extension, but not including the query string.
• property URLPrefix as %String;
If the url contains the configuration name of the server as the first piece then this is defined to be the correct prefix to prepend to urls so they include this config name
• property UserAgent as %String;
A string indicating the type of browser from which the request originated, as determined from the HTTP_USER_AGENT header.
• property WebSocketStatus as %Integer [ InitialExpression = 0 ];
The internal initialization status for the WebSocket.
• property store as %String [ Private,MultiDimensional ];
Used to keep track of old values

Methods


• private method AppDataSet(data As %String) as %Status
This is a Set accessor method for the AppData property.
• private method AppMatchSet(data As %String) as %Status
This is a Set accessor method for the AppMatch property.
• private method ApplicationSet(val As %String) as %Status
This is a Set accessor method for the Application property.
• private method CSPGatewayRequestSet(val As %String) as %Status
This is a Set accessor method for the CSPGatewayRequest property.
• final method CSPGatewayReset()
Internal function that resets some of the values in %CSP.Request object to its initial state. Only for use by the CSP engine itself.
• private method ClassSet(val As %String) as %Status
This is a Set accessor method for the Class property.
• private method ContentTypeSet(val As %String) as %Status
This is a Set accessor method for the ContentType property.
• final method Count(name As %String) as %Integer
Returns the number of values associated with the name-value pair name.
• final method CountCookie(name As %String) as %Integer
Returns the count of cookies with this name.
• final method CountMimeData(name As %String) as %Integer
Returns the count of multipart MIME streams with this name.
• final method Decrypt(data As %String, key As %String) as %Status
Given an encrypted string that is a series of name-value pairs and a key to decrypt it with this will insert them into the request and set the encrypted flag.
• final method Delete(name As %String, index As %Integer = "") as %Boolean
Removes this key from the collection, returns true if the valued existed and false if it never existed. This is deprecated in favour of accessing the Data directly because this is faster. This call is equivalent to the following:
	; If index=""
	Kill %request.Data(name)
	; If index'=""
	Kill %request.Data(name,index)
• final method DeleteCgiEnv(name As %String) as %Boolean
Removes this CGI environment variable from the collection, returns true if the item was defined and false if it was never defined.
• final method DeleteCookie(name As %String, index As %Integer = "") as %Boolean
Removes this cookie from the collection, returns true if the cookie existed and false if it never existed.
• final method DeleteMimeData(name As %String = "", index As %Integer = "") as %Integer
Removes this multipart MIME stream from the collection. Returns the number of nodes it has removed. If name is not defined then it will remove the entire set of MimeData, if name is defined but index is not then it will remove all items stored under name.
• method DetermineRequestType()
• final method Find(name As %String, value As %String) as %Integer
Returns the index of the name-value pair for name with value. If not found, return "".
• private method GatewayApplicationSet(val As %String) as %Status
This is a Set accessor method for the GatewayApplication property.
• private method GatewayBuildSet(val As %String) as %Status
This is a Set accessor method for the GatewayBuild property.
• private method GatewayConnectionNameSet(val As %String) as %Status
This is a Set accessor method for the GatewayConnectionName property.
• private method GatewayFunctionsSet(val As %String) as %Status
This is a Set accessor method for the GatewayFunctions property.
• private method GatewayInstanceNameSet(val As %String) as %Status
This is a Set accessor method for the GatewayInstanceName property.
• private method GatewaySessionCookieSet(val As %String) as %Status
This is a Set accessor method for the GatewaySessionCookie property.
• private method GatewaySessionIdSourceSet(val As %String) as %Status
This is a Set accessor method for the GatewaySessionIdSource property.
• final method Get(name As %String, default As %String = "", index As %Integer = 1) as %String
Returns the value of name-value pair name.

If more than one value is associated with name, then the values are subscripted using index starting with 1. Note that any encrypted parameters will have lower index values than any unencrypted parameters, and so will come first when you loop through them.

If the name-value pair is not defined, returns the value of default. This is deprecated in favour of accessing the Data directly because this is faster, for example this is equivalent to:

	Set return=$Get(%request.Data(name,index),default)
• final method GetCgiEnv(name As %String, default As %String = "") as %String
Retrieves the named CGI environment variable.
• final method GetCookie(name As %String, default As %String = "", index As %Integer = 1) as %String
Retrieves the named cookie
• final method GetMimeData(name As %String, default As %Stream.Object = "", index As %Integer = 1) as %Stream.Object
Retrieves the named multipart MIME stream.
• final method Insert(name As %String, value As %String)
Insert the value of name-value pair name to value.

If more than one value is associated with name, then the values are subscripted using index starting with 1. This is deprecated in favour of accessing the Data directly because this is faster, for example this is equivalent to:

	Set %request.Data(name,$Order(%request.Data(name,""),-1)+1)=value
• final method InsertCgiEnv(name As %String, value As %String)
Inserts a CGI environment variable by name into the collection.
• final method InsertCookie(name As %String, value As %String)
Inserts a cookie name/value pair.
• final method InsertMimeData(name As %String, value As %Stream.Object)
Inserts a multipart MIME stream by name into the collection.
• final method IsDefined(name As %String, index As %Integer = 1) as %Boolean
Tests if a name-value pair name is defined. This is deprecated in favour of accessing the Data directly because this is faster, for example this is equivalent to:
	Set return=$Data(%request.Data(name,index))
• final method IsDefinedCgiEnv(name As %String) as %Boolean
Returns true if the named CGI environment variable exists in the collection, false otherwise.
• final method IsDefinedCookie(name As %String, index As %Integer = 1) as %Boolean
Returns true if the named cookie exists in the cookie collection, false otherwise.
• final method IsDefinedMimeData(name As %String, index As %Integer = 1) as %Boolean
Returns true if the named multipart MIME stream exists in the collection, false otherwise.
• final method IsEncrypted(name As %String, index As %Integer = 1) as %Boolean
Return true if the name-value pair name at index is encrypted in the url and false if it is not. This is useful to check that a parameter value that should not be altered and so is generated and encrypted on the server has not been replaced by the user by a 'http://machine/url.csp?PARAM=TEST' rather than the encrypted string produced by the server. This is deprecated in favour of access the Data directly because this is faster, for example this is equivalent to:
	Set return=$Get(%request.Data(name,index,"encrypt"),0)
• final method Next(name As %String) as %String
Returns the next key in sequence. This is deprecated in favour of accessing the Data directly because this is faster. The call is equivalent to the code:
	Set return=$Order(%request.Data(name))
• final method NextCgiEnv(name As %String) as %String
Retrieves the next CGI environment variable name in the sequence
• final method NextCookie(name As %String) as %String
Retrieves the next cookie name in the sequence
• final method NextIndex(name As %String, ByRef index As %Integer = "") as %String
Pass the index by reference and it updates it with the next index number for the name-value pair name. The method returns the value at the new index number. This is useful for looping through the index values. This is deprecated in favour of accessing the Data directly because this is faster, for example this is equivalent to:
	Set index=$Order(%request.Data(name,index),1,return)
• final method NextMimeData(name As %String) as %String
Retrieves name of the next multipart MIME stream stored in the request object.
• final method NextMimeDataIndex(name As %String, index As %Integer = "") as %String
Return the index number of the next multipart MIME stream stored in the request object.
• method ProcessRequest(header As %String)
• private method ProtocolSet(val As %String) as %Status
This is a Set accessor method for the Protocol property.
• final method Reset()
Resets this %CSP.Request object to its initial state
• private method SecureSet(val As %String) as %Status
This is a Set accessor method for the Secure property.
• private method ServiceSet(val As %String) as %Status
This is a Set accessor method for the Service property.
• final method Set(name As %String, value As %String, index As %Integer = 1)
Set the name-value par name to value. As more than one value can be associated with name you can specify an index which is an integer subscript starting at 1 (the default). This is now deprecated in favour of accessing the Data directly because this is faster, for example this is equivalent to:
	Set %request.Data(name,index)=value
• method UpdateURL(url As %String, servername As %String = "", response As %CSP.Response, update As %Boolean = 0) as %Status
• private method UserAgentSet(val As %String) as %Status
This is a Set accessor method for the UserAgent property.
• private final method realDecrypt(data As %String, key As %String) as %Status
Internal utility function for decryption.