Tip : Usage of supportsRedirectWithHttp303 and supportsRedirectWithHttp302

Tip : Usage of supportsRedirectWithHttp303 and supportsRedirectWithHttp302

Current generation HTML/XHTML/CHTML/XML devices may implement HTTP 1.0, 1.1 or in some cases a hybrid solution.

The OutSystems platform allows developers to customize how the platform does redirects for Mobile Web devices by using a combination of the selected markup language being used as well has defining which HTTP status code the device needs in order to work correctly.

Per the HTTP 1.1 RFC, when a browser receives an HTTP 302 status code it should redirect to the given URL, and SHOULD notify the user if the original request was a POST. It should also make the redirected request with the GET method instead of POST.

Most web applications require the browsers to keep using the POST method but simply change the URL to where they are posting. HTTP status code 303 was created in HTTP 1.1 to address this specifically and an HTTP 1.1 compliant browser will keep using the POST method even after being redirected, plus it also won't notify the user thereby spoiling the user experience.

Prior to HTTP 1.1, it was assumed that HTTP 302 did not change the request method and simply changed the URL being used. While the HTTP 1.0 was somewhat vague regarding the specific behavior expected from the browsers, so the vast majority of browsers worked this way. In order to clarify this, HTTP 1.1 further detailed the intended browser behavior for 302 and created the new 303 to maintain compatibility with applications expecting the POST request chain not to be broken during redirects.

Whenever a device is using WML the OutSystems Hub Edition platform will generate a redirect WML card. For all other *ML (XHTML, HTML or CHTML) the platform will either send an HTTP status 302 or 303.

To choose between these two simply set the following variables inside the device database as follows:

' To use HTTP status 302
supportsRedirectWithHttp302 = true
supportsRedirectWithHttp303 = false

' Or to use HTTP status 303
supportsRedirectWithHttp302 = false
supportsRedirectWithHttp303 = true

So to sum up, should you find a device that is unable to work with either of these settings, gently ask the manufacturer for the latest firmware or to otherwise explain on which standard they are basing their HTTP implementation.

While resorting to WML rendering can be considered a workaround, the user experience is so limited when compared to the other alternatives most users will quickly discard it and simply avoid the service unless they have no other choice (usually because their device doesn't support other markup languages).