Using M-Business Client HTTP request headers to customize content

There will be times when you want finer control of the display on the client. The best example of this would be with logos. Sure, a color logo looks great on a high-end color Palm or a Pocket PC device, but it looks dithered on a black-and-white Palm. And while a posterized 4-color grayscale logo looks nice on a black-and-white Palm, when you look at it on a color device, it looks like a 4-color grayscale logo. What you would really like is the ability to serve up different images based on the device that is viewing your channel.

That is where the M-Business Client headers come in. As you already know, when a browser accesses your Web server, it sends across several headers in the HTTP page request. These are informational headers telling your server a little about the browser; what type of browser it is, what host it thinks it is connecting to, the language the client prefers, and other parameters as follows: all of which can be used to customize content.

Table 1. List of M-Business-specific headers

Header

Description

User-Agent

Mozilla/4.0 (compatible; AvantGo 5.5; Windows NT)

X-AvantGo-Version

base64 encoded

X-AvantGo-ColorDepth

base64 encoded

X-AvantGo-ClientLanguage

en_US

X-AvantGo-ScreenSize

base64 encoded

X-AvantGo-DeviceOS

base64 encoded

X-AvantGo-DeviceOSVersion

base64 encoded

X-AvantGo-UserId

base64 encoded

X-AvantGo-DeviceId

base64 encoded

X-AvantGo-ChannelId

en_US

For additional information, see Using server URL macros to customize content.


AG_USER example
Sample code
Using server URL macros to distribute content to multiple device types