On 6/25/07, prla <[EMAIL PROTECTED]> wrote: > > I'm developing a little mobile MIDP application which is supposed to > query a web app built using turbogears. The idea is to use the mobile > app to access something like http://<app url>/ and have it parse the > output (plain text should do it, the output is simple). > > When using the regular desktop browser, the app loads fine but when I > go through the app, the output is This resource resides temporarily at > <a href='http://localhost:8080/'>http://localhost:8080/</a>. > Incidentally, that's exactly what happens when I try to use wget, for > instance: all I get is the HTML corresponding to the root of the app. > In both cases, thus, I get a 302. > > Is this normal behavior? How then should I query the web server in > order to incorporate server data into the mobile app? Basically, this > is a grocery list which I want to able to download to mobile phones on > demand. > what you are getting is a "redirect" or http "error code" 302 that means what you are looking for is not here and it is in another place (specified in headers), what is happening is that your "browser code" isn't handling those and probably wget isn't either although I though it did on the default configuration.
You may try several things the simplest will be to point to the full resource and avoid the redirect, or you could have your client code handle those. if you want to go the second way and your client code is python take a look at http://docs.python.org/lib/http-redirect-handler.html on a side note why not set return_json=True instead of "parsing" the page, if the message are small they are several APIs for it in almost every popular language at json.org > Thanks, > > P. > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~----------~----~----~----~------~----~------~--~---

