Request Class Methods
In this section, we discuss the Request class methods. The methods are discussed in alphabetical order.
Syntax
FormFactor(form_factor)
Description
Use the FormFactor method to return the ceiling (the maximum device width in physical pixels) defined in the web server's configuration files for the specified form factor.
Important! Use this method within fluid applications only.
Parameters
Field or Control |
Definition |
---|---|
form_factor |
Specifies the form factor as an integer. The value can be one of the following constants: |
Numeric Value |
Constant Value |
Default Ceiling (in physical pixels) |
---|---|---|
0 |
%FormFactor_Small |
519 |
1 |
%FormFactor_Medium |
759 |
2 |
%FormFactor_Large |
959 |
3 |
%FormFactor_Xlarge |
999,999 |
Returns
An Integer value.
Example
If %Request.FormFactor(%FormFactor_Small) <= 400 Then
...
End-If;
Syntax
GetContentBody()
Description
Note: PeopleSoft Business Interlinks is a deprecated product. This method currently exists for backward compatibility only.
This method retrieves the text content of an XML request. This is part of the incoming Business Interlink functionality, which enables PeopleCode to receive an XML request and return an XML response.
Parameters
None.
Returns
A string.
Example
The following example gets the XML text content of a request, then uses that as input to create a BiDoc. Then the BiDoc methods GetDoc and GetValue are used to access the value of the skills tag.
Local BIDocs &rootInDoc, &postreqDoc;
Local string &blob;
Local number &ret;
&blob = %Request.GetContentBody();
/* process the incoming xml(request)- Create a BiDoc */
&rootInDoc = GetBiDoc(&blob);
&postreqDoc = &rootInDoc.GetDoc("postreq");
&ret = &postreqDoc.GetValue("skills", &skills);
Syntax
GetCookieNames()
Description
This method returns an array containing names of all the cookies present in this request. If there are no cookies in the request, an empty array is returned. When cookies are present, this method returns an array of strings.
Syntax
GetCookieValue (name)
Description
This method returns a string containing value of the cookie identified name. The name parameter takes a string value. The NPmatch between name and the request cookie is case-insensitive. If there is no cookie in the request matching the name, an empty string is returned.
Syntax
GetDeviceInfo(attribute)
Description
Use the GetDeviceInfo method to detect and return a value for the specified device attribute.
Important! Use this method within fluid applications only.
Parameters
Field or Control |
Definition |
---|---|
attribute |
Specifies one of the listed device attributes as a string value: |
Attribute |
Returns |
---|---|
width |
The device's width in physical pixels. |
height |
The device's height in physical pixels. |
pixelratio |
The ratio between physical pixels and device-independent pixels (dips) on the device. |
touch |
Whether the device supports touch events:
|
geolocation |
Whether the device supports the geolocation API:
|
websockets |
Whether the device supports the WebSockets API:
|
webworkers |
Whether the device supports the Web Workers API:
|
datepicker |
Whether the device supports the DatePicker widget:
|
dtpicker |
Whether the device supports the DateTimePicker widget:
|
timepicker |
Whether the device supports the TimePicker widget:
|
dnd |
Whether the device natively supports drag-and-drop:
|
sessionstorage |
Whether the device supports the sessionStorage object:
|
localstorage |
Whether the device supports the localStorage object:
|
history |
Whether the device supports the history API:
|
canvas |
Whether the device supports the <canvas> element:
|
svg |
Whether the device supports the Scalable Vector Graphics (SVG) format:
|
postmessage |
Whether the device supports the window.postMessage method:
|
hc |
Whether the device supports a high contrast mode:
|
Returns
An Integer value.
Example
&dev_info = %Request.GetDeviceInfo("width");
Syntax
GetHeader(name)
Description
This method returns the value of the header requested by the string name. The match between name and the request header is case-insensitive. If the header requested does not exist, an empty string is returned.
Example
The following example gets the "Referer" header to see where the request came from:
&Referer = %Request.GetHeader("Referer");
Syntax
GetHeaderNames()
Description
This method returns an array of Strings representing the header names for this request.
Syntax
GetHelpURL(HelpContext)
Description
This method returns the help context path (as a string) to the help directory. It's used to construct a URL to a specific help page.
Example
&HelpURLString = %Request.GetHelpURL("hc0110");
Syntax
GetParameter(name)
Description
This method returns the value of a specified query string parameter or posted form data parameter. The match between name and the request parameter is case-insensitive. If there are multiple parameter values for a single name, the value returned is the first value in the array returned by the GetParameterValues method. If the parameter has (or could have) multiple values, you should use the GetParameterValues method in your Internet scripts.
Related Links
Syntax
GetParameterNames()
Description
This method returns all the parameter names for this request as an array of Strings, or an empty array if there are no input parameters.
Syntax
GetParameterValues(name)
Description
This method returns the values of the specified parameter (name) as an array of Strings, or an empty array if the named parameter does not exist. The name parameter takes a string value.