7.3 IMPORTANT DETAIL IS IN THE HTTP HEADERS

Before going on to analyse the basics of the HTTP mechanism in the mobile context, let's make a few observations about the process just described.

In the request cycle (see Figure 7.3), we can see a header called User-agent, which is a string that informs the origin server what type of user agent is making the request. For example, it could indicate that the user agent is a particular browser vendor running on a particular mobile device. This information is potentially useful to the origin server, particularly in the mobile context. This is because there are many different types of device, from limited display mass-manufactured handsets to very feature-rich larger format smartphone devices. Even within the same device class, there can be vast differences in display capabilities between different generations of device, as shown in Figure 7.4. Clearly, we would not want to send a response with detailed colour graphics to a device that is unable to display them. Thus, we can use the user agent header to assist our origin server with deciding what content to dish up according to device characteristics.

In theory, this process is also aided by the accept header that we can also see in the example (Figure 7.3). This is a list of content types that the user agent can accept. For example, if the device can display GIF (graphic interchange format) images, then it says so in the accept header. If it can't, then this is omitted and the origin server ...

Get Next Generation Wireless Applications: Creating Mobile Applications in a Web 2.0 and Mobile 2.0 World, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.