Key HTTP headers included with browser requests

The BlackBerry® Browser includesa number of HTTP headers with each request. You can use the following headers to ensure that you send the optimal content or resources for the BlackBerry device, the network, and the user.

Header

Description

User-Agent

The User-Agent header is sent by all browsers with every content request. The value of this header is a string that identifies the browser making the request.

With the adoption of WebKit in BlackBerry 6, the format and content of the User-Agent string for the BlackBerry Browser has changed so that it resembles other WebKit based browsers.

In BlackBerry 6, the User-Agent string uses the following form:

Mozilla/5.0 (BlackBerry; U; BlackBerry <model>; en-US) AppleWebKit/<webkit_version> (KHTML, like Gecko) Version/<version> Mobile Safari/<webkit_version>

where

  • <model> is the model number of the BlackBerry device that makes the request
  • <version> is the version of the BlackBerry® Device Software the BlackBerry device runs
  • <webkit_version> is the version of the WebKit engine that the browser uses

Accept

The Accept header is sent by all browsers with every content request. The value of this header provides information about the content types that the requesting browser accepts. This header does not reflect the browser settings specified by the BlackBerry device user. For example, this header always indicates that the browser accepts JavaScript®, even if the user disables JavaScript in the browser.

The Accept header uses the following form:

text/html,application/xhtml+xml,application/xml,application/x-javascript,*/*;q=0.5

Accept-Language

The Accept-Language header is sent by all browsers with every content request. The value of this header provides information about the language preferences of the user. The BlackBerry Browser populates the value for this header by using the display language that the user specifies in the Options application. The user can not set the language within the browser itself.

This header is commonly used as a simple way to infer the locale of the user. For example, if the value of the Accept-Language header is de-at (Austrian German), you can reasonably assume that the user is located in Austria.

x-wap-profile

The x-wap-profile header is unique to mobile devices. This header provides information about the device that requests the content.

The value of this header is a URL of the RDF file for the BlackBerry device making the request. The RDF file is an XML-based document that provides hardware information and supported features of the BlackBerry device. You can use this information to, for example, determine the device input method, the device screen size, and other device-specific information.

The URL string also includes information about the network the browser is using, allowing you to determine whether the request is made over a wireless network or a Wi-Fi® connection.

The x-wap-profile URL string uses the following form:

"http://www.blackberry.net/go/mobile/profiles/uaprof/<BlackBerry-model>_<network-bearer>/<software-version>.rdf".

where:

  • <BlackBerry-model> is the model number of the BlackBerry device
  • <network-bearer> is the network over which the BlackBerry Browser is currently communicating
  • <software-version> is the version of the BlackBerry Device Software

Was this information helpful? Send us your comments.