I am using werkzeug 0.62.
When I use get the request.args dict gets filled, when I use post it
does not.
>From what I read, it is supposed to work with post as well.
Here is a simple app:
When I change the method from post to get, the form keys show up.
In both cases, the browser and method show up, so I know the request
is working.
from werkzeug import Request
def application(environ, start_response):
output=[]
#create a simple form:
output.append('<form method="post">')
output.append('<input type="text" name="test">')
output.append('<textarea name="test2" cols="50" rows="10"></
textarea>')
output.append('<select name="test3"><option value="1">1</
option><option value="2">2</option></select>')
output.append('<input type="submit">')
output.append('</form>')
if environ['REQUEST_METHOD'] in ['POST','GET'] :
# show form data as received by POST:
output.append('<h1>FORM DATA</h1>')
request = Request(environ)
output.append('<br>Form Keys=%s' % (request.args.keys(),))
output.append("browser=%s<br>" % request.user_agent.browser)
output.append("method=%s<br>" % request.method)
# send results
output_len = sum(len(line) for line in output)
start_response('200 OK', [('Content-type', 'text/html'),
('Content-Length', str(output_len))])
return output
--
You received this message because you are subscribed to the Google Groups
"pocoo-libs" 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/pocoo-libs?hl=en.