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.
Thanks,
P.
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.
>
>
> >
>
what you are getting is a "redirect" or http "error code" 302 thatmeans 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 thoughit did on the default configuration.
You may try several things the simplest will be to point to the fullresource and avoid the redirect, or you could have your client codehandle those. if you want to go the second way and your client code ispython take a look at
on a side note why not set return_json=True instead of "parsing" thepage, if the message are small they are several APIs for it in almostevery popular language at json.org
This is the normal behavior from CherryPy when you access the index page
handler of the application with a trailing '/', it will redirect you to
the correct URL with the trailing '/'. It works in your browser because
it understands the 302 and automatically performs the request at the
correct URL (look at your CP log).
So the question really is why not using the URL with the trailing '/' in
the first place? :)
- Sylvain
On Jun 26, 2007, at 1:55 AM, Jorge Vargas wrote:what you are getting is a "redirect" or http "error code" 302 thatmeans 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 thoughit did on the default configuration.But why am I getting this redirect in the first place?
Above I meant *without* the trailing '/'. Sorry.
Er... that too...
- Sylvain