IRISLIB database
Request Class Reference

The <CLASS>CSP.Request</CLASS> class encapsulates an incoming URL and its parameters. More...

Inheritance diagram for Request:
Collaboration diagram for Request:

Public Member Functions

_.Library.Integer Count (_.Library.String name)
 Returns the number of values associated with the name-value pair name.
 
_.Library.Integer CountCookie (_.Library.String name)
 Returns the count of cookies with this name.
 
_.Library.Integer CountMimeData (_.Library.String name)
 Returns the count of multipart MIME streams with this name.
 
_.Library.Status Decrypt (_.Library.String data, _.Library.String key)
 Given an encrypted string that is a series of name-value pairs and a key More...
 
_.Library.Integer Find (_.Library.String name, _.Library.String value)
 Returns the index of the name-value pair for name More...
 
_.Library.String Get (_.Library.String name, _.Library.String default, _.Library.Integer index)
 Returns the value of name-value pair name. More...
 
_.Library.String GetCgiEnv (_.Library.String name, _.Library.String default)
 Retrieves the named CGI environment variable.
 
_.Library.String GetCookie (_.Library.String name, _.Library.String default, _.Library.Integer index)
 Retrieves the named cookie.
 
_.Stream.Object GetMimeData (_.Library.String name, _.Stream.Object default, _.Library.Integer index)
 Retrieves the named multipart MIME stream.
 
 Insert (_.Library.String name, _.Library.String value)
 Insert the value of name-value pair name to value. More...
 
_.Library.Boolean IsDefined (_.Library.String name, _.Library.Integer index)
 Tests if a name-value pair name is defined. More...
 
_.Library.Boolean IsDefinedCgiEnv (_.Library.String name)
 Returns true if the named CGI environment variable exists in the collection, false otherwise.
 
_.Library.Boolean IsDefinedCookie (_.Library.String name, _.Library.Integer index)
 Returns true if the named cookie exists in the cookie collection, false otherwise.
 
_.Library.Boolean IsDefinedMimeData (_.Library.String name, _.Library.Integer index)
 Returns true if the named multipart MIME stream exists in the collection, false otherwise.
 
_.Library.Boolean IsEncrypted (_.Library.String name, _.Library.Integer index)
 Return true if the name-value pair name at index is encrypted in the. More...
 
_.Library.String Next (_.Library.String name)
 Returns the next key in sequence. More...
 
_.Library.String NextCgiEnv (_.Library.String name)
 Retrieves the next CGI environment variable name in the sequence.
 
_.Library.String NextCookie (_.Library.String name)
 Retrieves the next cookie name in the sequence.
 
_.Library.String NextIndex (_.Library.String name, _.Library.Integer index)
 Pass the index by reference and it updates it with the next index number for. More...
 
_.Library.String NextMimeData (_.Library.String name)
 Retrieves name of the next multipart MIME stream stored in the request object.
 
_.Library.String NextMimeDataIndex (_.Library.String name, _.Library.Integer index)
 Return the index number of the next multipart MIME stream stored in the request object.
 
 Reset ()
 Resets this CSP.Request object to its initial state.
 
- Public Member Functions inherited from RegisteredObject
_.Library.Status OnAddToSaveSet (_.Library.Integer depth, _.Library.Integer insert, _.Library.Integer callcount)
 This callback method is invoked when the current object is added to the SaveSet,. More...
 
_.Library.Status OnClose ()
 This callback method is invoked by the <METHOD>Close</METHOD> method to. More...
 
_.Library.Status OnConstructClone (_.Library.RegisteredObject object, _.Library.Boolean deep, _.Library.String cloned)
 This callback method is invoked by the <METHOD>ConstructClone</METHOD> method to. More...
 
_.Library.Status OnNew ()
 This callback method is invoked by the <METHOD>New</METHOD> method to. More...
 
_.Library.Status OnValidateObject ()
 This callback method is invoked by the <METHOD>ValidateObject</METHOD> method to. More...
 

Public Attributes

 AppMatch
 Portion of the url which we matched on to determine the web application settings to use. More...
 
 Application
 The section of the Url that has been matched against a CSP application name. More...
 
 CSPGatewayRequest
 True if the request came the CSP Gateway, and false if it was from the. More...
 
 CgiEnvs
 An array of strings containing any environment values associated with this request. More...
 
 CharSet
 Character set this request was send in, if not specified in the HTTP headers. More...
 
 Content
 A <class>CSP.Stream</class> containing the content submitted. More...
 
 ContentType
 A string indicating the MIME Content-Type of the request. More...
 
 Cookies
 An array of strings containing any cookie values associated with this request. More...
 
 Data
 An array of strings containing any parameter name/value pairs associated with this request. More...
 
 GatewayApplication
 The section of the Url that the CSP Gateway on the web server matched. More...
 
 GatewayBuild
 The internal build version of the CSP Gateway talking to the server. More...
 
 GatewayConnectionName
 The name of the connection in the CSP Gateway that this request was sent to. More...
 
 GatewayInstanceName
 The instance host name of the Gateway that is communicating with this process. More...
 
 GatewayNewId
 True if the sessionId is newly assigned by the Gateway, and false if it is provided by the browser. More...
 
 GatewaySessionCookie
 The session cookie that the Gateway picked as the sessionId. More...
 
 GatewayTimeout
 The value of the Server Response Timeout in the Gateway configuration. More...
 
 Method
 A string indicating HTTP method used for this request. More...
 
 MimeData
 An array of streams containing any multipart/mime data associated with this request. More...
 
 NoResetTimeout
 If set to true then do not reset the session timeout for this request. More...
 
 PageName
 A string containing the name of the CSP page being processed. More...
 
 Protocol
 HTTP protocol version of the browser request. More...
 
 RegistryMethods
 The status of Registry Methods [1:Enabled; 0:Disabled]. More...
 
 RequestId
 The Gatewway Request Id. More...
 
 Secure
 True if the communication between the browser and the web server was using. More...
 
 URL
 A string containing the URL up to and including the page name. More...
 
 URLPrefix
 If the url contains the configuration name of the server as the first piece. More...
 
 UserAgent
 A string indicating the type of browser from which the request. More...
 

Private Member Functions

_.Library.Status __ClassSet (_.Library.String val)
 The <CLASS>CSP.Request</CLASS> class encapsulates an incoming URL and its parameters. More...
 

Additional Inherited Members

- Static Public Attributes inherited from RegisteredObject
 CAPTION = None
 Optional name used by the Form Wizard for a class when generating forms. More...
 
 JAVATYPE = None
 The Java type to be used when exported.
 
 PROPERTYVALIDATION = None
 This parameter controls the default validation behavior for the object. More...
 

Detailed Description

The <CLASS>CSP.Request</CLASS> class encapsulates an incoming URL and its parameters.

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

Member Function Documentation

◆ __ClassSet()

_.Library.Status __ClassSet ( _.Library.String  val)
private

The <CLASS>CSP.Request</CLASS> class encapsulates an incoming URL and its parameters.

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

◆ Decrypt()

_.Library.Status Decrypt ( _.Library.String  data,
_.Library.String  key 
)

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.

◆ Find()

Returns the index of the name-value pair for name

with value. If not found, return "".

◆ Get()

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.

It is recommended to access the <property>Data</property> property directly because it is faster. For example, this call is equivalent to:

Set return=$Get(request.Data(name,index),default)

◆ Insert()

Insert ( _.Library.String  name,
_.Library.String  value 
)

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.

It is recommended to access the <property>Data</property> property directly because it is faster. For example, this call is equivalent to:

Set request.Data(name,$Order(request.Data(name,""),-1)+1)=value

◆ IsDefined()

_.Library.Boolean IsDefined ( _.Library.String  name,
_.Library.Integer  index 
)

Tests if a name-value pair name is defined.

It is recommended to access the

<property>Data</property> property directly because it is faster. For example, this call is equivalent to:

Set return=$Data(request.Data(name,index))

◆ IsEncrypted()

_.Library.Boolean IsEncrypted ( _.Library.String  name,
_.Library.Integer  index 
)

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.

It is recommended to access the <property>Data</property> property directly because it is faster. For example, this call is equivalent to:

Set return=$Get(request.Data(name,index,"encrypt"),0)

◆ Next()

Returns the next key in sequence.

It is recommended to access the

<property>Data</property> property directly because it is faster. For example, this call is equivalent to:

Set return=$Order(request.Data(name))

◆ NextIndex()

_.Library.String NextIndex ( _.Library.String  name,
_.Library.Integer  index 
)

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.

It is recommended to access the <property>Data</property> property directly because it is faster. For example, this call is equivalent to:

Set index=$Order(request.Data(name,index),1,return)

Member Data Documentation

◆ AppMatch

AppMatch

Portion of the url which we matched on to determine the web application settings to use.

 

◆ Application

Application

The section of the Url that has been matched against a CSP application name.

 

◆ CSPGatewayRequest

CSPGatewayRequest

True if the request came the CSP Gateway, and false if it was from the.

command line or the built in web server.  

◆ CgiEnvs

CgiEnvs

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.  

◆ CharSet

CharSet

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.  

◆ Content

Content

A <class>CSP.Stream</class> containing the content submitted.

with this request.  

◆ ContentType

ContentType

A string indicating the MIME Content-Type of the request.

 

◆ Cookies

Cookies

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.  

◆ Data

Data

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"))

If InterSystems IRIS receives a value that is longer than the string length limit, it automatically creates a stream, writes the value to that stream, and places the stream OREF into the Data property in place of the actual value. This means that in any case where you might receive a very long string, your code should examine the value to see if it is an OREF, and then handle it accordingly:

Set value=request.Data("fieldname",1) If $isobject(value) { ; Treat this as a stream } Else { ; Treat this as a regular string }

 

◆ GatewayApplication

GatewayApplication

The section of the Url that the CSP Gateway on the web server matched.

against to determine which InterSystems IRIS 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'.  

◆ GatewayBuild

GatewayBuild

The internal build version of the CSP Gateway talking to the server.

 

◆ GatewayConnectionName

GatewayConnectionName

The name of the connection in the CSP Gateway that this request was sent to.

 

◆ GatewayInstanceName

GatewayInstanceName

The instance host name of the Gateway that is communicating with this process.

 

◆ GatewayNewId

GatewayNewId

True if the sessionId is newly assigned by the Gateway, and false if it is provided by the browser.

 

◆ GatewaySessionCookie

GatewaySessionCookie

The session cookie that the Gateway picked as the sessionId.

 

◆ GatewayTimeout

GatewayTimeout

The value of the Server Response Timeout in the Gateway configuration.

 

◆ Method

Method

A string indicating HTTP method used for this request.

Normally one

of 'GET', 'POST', or 'HEAD'.  

◆ MimeData

MimeData

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.  

◆ NoResetTimeout

NoResetTimeout

If set to true then do not reset the session timeout for this request.

Useful if this request is checking some state on the session but does not want to reset the timeout and cause the session to last longer. This property is set automatically if you pass in query parameter 'CSPNoResetTimeout'.  

◆ PageName

PageName

A string containing the name of the CSP page being processed.

 

◆ Protocol

Protocol

HTTP protocol version of the browser request.

Normally either

'HTTP/1.0' for older browsers and 'HTTP/1.1' for newer browsers.  

◆ RegistryMethods

RegistryMethods

The status of Registry Methods [1:Enabled; 0:Disabled].

 

◆ RequestId

RequestId

The Gatewway Request Id.

 

◆ Secure

Secure

True if the communication between the browser and the web server was using.

the secure https protocol. False for a normal http connection.  

◆ URL

URL

A string containing the URL up to and including the page name.

and extension, but not including the query string.  

◆ URLPrefix

URLPrefix

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  

◆ UserAgent

A string indicating the type of browser from which the request.

originated, as determined from the HTTP_USER_AGENT header.