[uWSGI] got 500 when handling POST request with post-data

Roberto De Ioris roberto at unbit.it
Fri Jul 30 15:33:13 CEST 2010


Il giorno 30/lug/2010, alle ore 15.23, 景俊吕 ha scritto:

> Hi guys,
> 
> I setup an environment with uwsgi + apache and mount my app on it. The app simply returns a json string. It handles GET req and POST req (without any post-data) properly, but returns 500 when there is data posted to it. The app codes and all configurations are list below.
> 
> ---app codes (test.py)---
> import simplejson
> def application(env, start_response):
>     output = simplejson.dumps({'foo': 'bar'})
>     start_response('200 OK', [('Content-Type', 'text/html')])
>     return [output]
> 
> --


You have to read the post body (if there is some) otherwise your internal (kernel level) socket buffer
will do all sort of bad things. This is an already discussed topic and we are trying to find an 'automagic'/clean solution
to ignore body on demand. In the mean time, simply do not ignore the POST body (read it in python)

--
Roberto De Ioris
http://unbit.it
JID: roberto at jabber.unbit.it



More information about the uWSGI mailing list