UP.SDK Developer's Guide

[Cover] [Previous Section] [Next Section] [Index]

Current chapter: Dynamic WML Services
Section 25 out of 61 total sections , Section 7 out of 9 sections in this chapter


Retrieving subscriber, device, and UP.Link information

When the UP.Link Server makes an HTTP request to a WML service, it adds headers that provide information about the subscriber, the UP.Phone, and the UP.Link Server. These headers are converted by the Web server to environment variables, which you can retrieve using facilities such as the C function, getenv(), or the special Perl array, @ENV. The whoami.cgi example CGI script included with the UP.SDK provides a simple example of how to retrieve these environment variables.

The following table lists the environment variables set by the UP.Link HTTP request headers.

Environment Variable  Description 
HTTP_ACCEPT_
LANGUAGE
 

Specifies the language(s) in use on the device. 

The variable specifies a comma-separated list of language-country identifiers as defined in ISO 639 and the two character country codes as defined in ISO 3166. A list of these codes is provided at: 

http://www.unicode.org  

The following are some examples 

en: English
en-gb: Great Britain English
ja: Japanese 

WML services should check this variable and attempt to deliver localized content in the specified language. For more information on character set and localization issues, see Chapter 9

HTTP_COOKIE  

HTTP cookies in the standard format compatible with RFC-2109. The UP.Link Server and UP.Simulator both store persistent cookies. The UP.Simulator manages cookies in HTTP direct mode and stores them in a CookieCache file. In UP.Link mode, the server manages cookies and never delivers them to the UP.Simulator. 

For more information about UP.Simulator modes, see Chapter 1 in the UP.SDK Tools and APIs Guide

To set cookies from a CGI script, see the addCookie method in the UP.SDK Tools and APIs Guide

HTTP_REFERER  

The URL of the deck originating the request. This variable is set only if you specify sendreferer="true" when you define the <go> statement that generates the request. For more information on this option, see Checking the HTTP Referer header on page 106

HTTP_USER_AGENT  

A string with the format: 

Browser/Browser_version
UP.Link/uplink_version
 

For example: 

UP.Browser/3.1-ALCS
UP.Link/3.1.3
 

HTTP_X_UP_DEVCAP_
IMMED_ALERT
 

A value specifying whether the device does (1) or
does not (0) support immediate alerts. 

HTTP_X_UP_DEVCAP_
MAX_PDU
 

The maximum packet size supported by the device (normally 1492 but configurable by the UP.Link operator). 

HTTP_X_UP_DEVCAP_
NUMSOFTKEYS
 

The number of softkeys on the device. 

HTTP_X_UP_DEVCAP_
SCREENPIXELS
 

The width and height of the display in pixels. For example, the value 264,116 indicates the display is 264 pixels wide by 116 pixels high. 

HTTP_X_UP_DEVCAP_
SCREENCHARS
 

The width and height of the display in characters. 

HTTP_X_UP_DEVCAP_
SCREENDEPTH
 

The depth of the display in pixels. 

HTTP_X_UP_DEVCAP_
MSIZE
 

The width in pixels of the character, "M." 

HTTP_X_UP_DEVCAP_
NUMSOFTKEYS
 

A value specifying the number of softkeys. 

HTTP_X_UP_DEVCAP_
SOFTKEYSIZE
 

A value specifying the maximum number of characters allowed for softkey labels. 

HTTP_X_UP_DEVCAP_
ISCOLOR
 

Specifies whether the display is grayscale or color. 

HTTP_X_UP_DEVCAP_
IMMED_ALERT
 

A value specifying whether the device does (1) or does
or does not (0) support immediate alerts. 

HTTP_X_UP_DEVCAP_
SMARTDIALING
 

A value specifying whether the device does (1) or
does not (0) support smart dialing. 

HTTP_X_UP_FAX_
ACCEPTS
 

A comma-delimited string specifying acceptable fax types (MIME content types). UP.Link Servers (version 3.0 and above) commonly support the following types: 

text/plain
application/postscript
application/msword
application/rtf
application/pdf  

HTTP_X_UP_FAX_
ENCODINGS
 

A comma-delimited list of the fax encoding types that the UP.Link Server accepts. By default, the UP.Link Server always accepts faxes with 7-bit encoding. If you omit this HTTP header, that is the only type it accepts. Other types UP.Link Servers may accept are: 8-bit or base64. 

HTTP_X_UP_FAX_
LIMIT
 

The maximum fax size (in bytes) that the UP.Link Server accepts. 

HTTP_X_UP_SUBNO  

The subscriber ID. The ID is globally unique (in other words, across all UP.Link Servers throughout the world) and has a maximum length of 32 characters. 

HTTP_X_UP_UPLINK  

The host on which the UP.Link is installed. 


IMPORTANT     Because the HTTP request headers are set by the UP.Link Server, they are simulated when you run the UP.Simulator in HTTP Direct mode.


[Cover] [Previous Section] [Next Section] [Index]


Copyright © 2000, Phone.com Inc. All rights reserved.
Please send comments and questions to doc-comments@corp.phone.com.