On Wednesday, June 25, 2008 5:57:51 PM UTC+2, Robert Corsaro wrote:
>
> You can also use paste:
> {{{
> from paste import request
>
> def application(environ, start_response):
>     if (environ['REQUEST_METHOD'] == 'POST):
>         fields = request.parse_formvars(environ)
>         field1 = fields.get('field1', 'default)
> }}}
>
> paste has more then a few convenience methods.
>
>
Beautiful answer! Update 2013:



from webob import Request

def application(environ, start_response):
    if (environ['REQUEST_METHOD'] == 'POST):
        req = Request(environ)
        field1 = req.params.get('field1', 'default')



webob can be installed in Ubuntu with:
sudo apt-get install python-webob

read more about webob at:
https://en.wikipedia.org/wiki/Python_Paste
http://webob.org/
http://docs.repoze.org/moonshining/tools/webob.html

-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to