What is the maximum length URL?
This is may be handset dependent; on a desktop, it is definitely browser dependent, as discussed in this question.
I am interested in specifications or references as much as empirical data.
My particular usecase is passing a very long (about 1600 character) URL to a MIDlet.platformRequest(String url), which is failing. The majority of the URL (some 1575 characters) is query.
Are there any other considerations for passing very long URLs about (e.g. mobile proxies and gateways truncating the URL)?
Short answer: it depends, but probably long enough.
Long answer, following investigation on SonyEricsson J2ME emulator (WTK 2.2.4), a K610i, and Samsung U700V.
Empirically testing: from the emulator, the
platformRequest()passes the URL straight to the desktop browser (Firefox in this case).Looking at the logs of a test server, we see we can pass through very long URLs from the emulator to the desktop to the server.
On a device (in this case, a SonyEricsson K610i, user agent: “SonyEricssonK610i/R1CB Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1”) can handle at least a URL of at least 3072 characters (upper bound c.3800).
On a second device Samsung U700V, user agent: “Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7 MG(Novarra-Vision/7.3)”, the lower bound for URL length was 2048, but upper bound was less than 3072. Note that this could be a problem with Novarra transcoder, which has been known to (at least) re-write user-agent strings.
Without the Novarra transcode (switching networks), the U700V has a user agent “SAMSUNG-SGH-U700-Vodafone/BUGK1 SHP/VPP/R5 NetFront/3.4 Qtv5.3 SMM-MMS/1.2.0 profile/MIDP-2.0 configuration/CLDC-1.1”, and has a lower bound of 3072 chars.
This effectively ends my interest in the answer to this question, as this empirical testing invalidates my theory that an upper bound on URL length is causing my problem.
However, for completeness, I will include a potential cause of my problem:
The URL needed to connect has at least two query parameters. The ampersands separating the queries seem to confuse the emulator.
The emulator silently drops the second parameter.
On the Samsung, without a second parameter, the browser connects, but the long parameter is corrupted or missing.
On the K610i when a second parameter is used, the browser does not start properly.