On 12 Dec 2013, at 2:34 AM, Niphlod <[email protected]> wrote: > it should have been. If you're still experiencing issues please post your > findings.
Do you recall what the issue was? I'm curious, because I have a 2.5.1 server at the moment serving up application/json. > > On Thursday, December 12, 2013 2:46:51 AM UTC+1, Vincent Audebert wrote: > Oh it has been fixed with 2.8.2? (that was the purpose of my first question. > Sorry if I was not clear) > > On Thursday, August 1, 2013 6:53:09 PM UTC+12, Ray (a.k.a. Iceberg) wrote: > To whom it may concern: > > I tried posting vars in json format, with content-type: application/json > header, to my web2py application. > > When the above test is run on my laptop, i.e. requests are sent directly to > web2py's rocket web server, recent web2py (the 2.5.1-stable) can successfully > decode the payload into request.vars, as expected as mentioned in > https://groups.google.com/d/msg/web2py/9YdxVpuJlA8/ek0zJae5U9YJ > > But when I deploy my application to my production server, the same web2py > 2.5.1-stable can not recognize the payload and the request.vars are always > empty. How come? > > My production server is running a web2py (was 2.4.6, and then manually > overwritten by those files in 2.5.1's web2py_src.zip), behind apache's > mod_wsgi, (which itself is behind a global nginx, but that architecture is a > webfaction convention which I think is not relevent). > > Below is the request full content: > > POST /examples/simple_examples/status/foo/bar.json HTTP/1.1 > content-type: application/json > Host: example.com > Content-Length:14 > user-agent: fake > Connection:Keep-Alive > > {"foo": "bar"} > > > And below is part of the web2py response, showing the request content. You > can see web2py got the correct content type header, but still fail to decode > the json payload in request. > > env : > > > > > > > content_length : 14 > content_type : application/json > http_connection : close > http_forwarded_request_uri : > /examples/simple_examples/status/foo/bar.json > http_host : sandbox.xxxxxxxx.com > http_http_x_forwarded_proto : http > http_https : off > http_user_agent : fake > http_x_forwarded_for : 107.23.xxx.xxx > http_x_forwarded_host : sandbox.xxxxxxxx.com > http_x_forwarded_proto : http > http_x_forwarded_server : sandbox.xxxxxxxx.com > http_x_forwarded_ssl : off > > post_vars : > > vars : > > wsgi : > environ : > CONTENT_LENGTH : 14 > CONTENT_TYPE : application/json > > > > > > -- > Resources: > - http://web2py.com > - http://web2py.com/book (Documentation) > - http://github.com/web2py/web2py (Source code) > - https://code.google.com/p/web2py/issues/list (Report Issues) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.

