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

Current chapter: Creating a Dynamic HDML Service
Section 26 out of 67 total sections , Section 6 out of 8 sections in this chapter


Retrieving subscriber, device, and UP.Link information

When the UP.Link server makes an HTTP request to an HDML 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 

HDML 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, Creating Globally Accessible HDML Services 

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 cookie cache 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 Reference

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

HTTP_REFERER  

The URL of the deck originating the request. This variable is set only if the task that generates the request sets the SENDREFERER task option to TRUE. For more information on this option, see Checking the HTTP request Referer heading

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.1
 
HTTP_X_UP_DEVCAP_
CHARSET
 

The character set used by the device. For a list of character set names, see Character set names

Normally, you don't need to use this variable, because the UP.Link server transcodes the character set to the character understood by your service. For more information about character set transcoding and other character set issues, see Chapter 9, Creating Globally Accessible HDML Services 

HTTP_X_UP_DEVCAP_
IMMED_ALERT
 

A value specifying whether the device supports immediate alerts: 

0: it doesn't support them 

1: it does 

HTTP_X_UP_DEVCAP_
MAX_PDU
 

The maximum packet size supported by the device. Normally, this is 1492. 

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 following value 

264,116  

indicates the display is 264 pixels wide by 116 pixels high. 

HTTP_X_UP_DEVCAP_
SMARTDIALING
 

A value specifying whether the device supports smart dialing: 

0: it doesn't support them 

1: it does 

HTTP_X_UP_FAX_
ACCEPTS
 

A comma-delimited string specifying acceptable fax types (MIME content types). 

The following types are commonly supported by 3.1 UP.Link servers: 

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 this HTTP header is not specified, that is the only type it accepts. 

Other types some UP.Link servers accept are: 

8bit 

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     The UP.Link HTTP request headers don't work when you run the UP.Simulator in HTTP direct mode. Because they are set by the UP.Link server, they are available only when you run the UP.Simulator in UP.Link mode.


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

Current chapter: Creating a Dynamic HDML Service
Section 26 out of 67 total sections , Section 6 out of 8 sections in this chapter


Copyright © 1999, Unwired Planet, Inc. All rights reserved.