Yahoo! Mobile - Blueprint Blog
Get Yahoo! Go 3.0

Header Magic: Returning device specific content

Friday October 16th 2009

The great thing about Yahoo! Blueprint is that mobile web sites built on this platform will work on almost any mobile browser. Right now, the platform supports over 3500 devices, and this number is growing daily.

But even though Blueprint makes mobile web development so easy–there is only one code to write to cover all of the supported devices–there is still sometimes a need to deliver device specific content. For instance, a module that features videos should only be displayed on a phone that can actually play back videos. Or perhaps for an app store or consumables site that should only list items which will actually work on the user’s device.

Using Yahoo!’s request headers which are sent with every request to the developer’s server makes it possible to identify a device or even the device capabilities on the developer’s end. Depending on the header information, the developer can return optimized Blueprint XML back to Yahoo!’s infrastructure to get it rendered on the user’s phone.

The two most useful and most used headers are:

X-Device-Info
This header provides clear text information about the device maker, the model, and the operating system.

X-Device-Info: id=”4939392″; make=”Nokia”; model=”N95 8GB”; os=”Symbian”

X-Client-Accept
This header lists all the media types which are supported by the given browser. If you were to run a sports site that features a video section, for example, you may only want to return the Blueprint XML with the video section content when you see that the video media type is part of the X-Client-Accept header.

X-Client-Accept: video/, image/

Other headers can also be used to return region or language specific content. Please read the Headers section in the Blueprint documentation to see a full list of supported headers: http://developer.yahoo.com/mobile/blueprint/BPHTTPHeaders.html

Filed under: Mobile Widgets
Posted by Michael
Meet Yahoo! Blueprint in London
  • Categories

    • Mobile Widgets
    • Uncategorized
  • Archives

    • October 2009
    • September 2009
    • August 2009
    • July 2009
    • May 2009
    • April 2009
    • March 2009
    • February 2009
    • January 2009
    • December 2008
    • November 2008
    • October 2008
    • September 2008
    • August 2008
    • July 2008
    • June 2008
    • May 2008
    • April 2008
    • March 2008
    • February 2008
    • January 2008
  • Links

    • Yahoo!
    • Yahoo! Blueprint Developer Site
    • Yahoo! Developer Network
    • Yahoo! Mobile

Leave a Reply

Copyright © 2007 Yahoo! Inc. All rights reserved. Copyright Policy | Terms of Service | Send Feedback | Help | Privacy Policy.