04-24-2009 02:11 PM
I am writing an app that sends an http request. I am not using a data plan, but using the wi-fi connection instead. When I issue this request, I get a 302 response code. Normally these response codes are handled and redirected internally by whatever client software the device has installed.
Does anyone know why I am seeing this? Better yet, can anyone tell me the best way to get around this problem? Am I supposed to do the redirect myself?
Here is my code snippet:
connection = (HttpConnection)Connector.open(url);
responseCode = connection.getResponseCode();
04-24-2009 02:45 PM
I figured out why I am getting 302 code. My provider is trying to upsell me on to a data plan.
My question now is:
If I have wifi connection, is there a way to force my httpconnection to use that instead of my provider's data plan?
05-04-2009 02:17 PM
You can append ;interface=wifi to the end of your URL. Review the following for more information.
What Is - Different ways to make an HTTP or socket connection
Article Number: DB-00396
Network Transports Video
05-04-2009 02:39 PM
Talk to RIM about this- some of their services AFAIK hide all of this but you may not want it.
For example, what does the hiding server do with cookies in the 302 response? Just add them to the
resulting response or send them back with redirect?