Re: [Paste] get raw post

Top Page
Author: Ian Bicking
Date:  
To: huanghao.c
CC: paste-users
Subject: Re: [Paste] get raw post
Alec wrote:
> problem again.
>
> a html form containes multi-file、text fields, it will submit to my wsgi
> app,
> in this wsgi app, I wanna catch all post data and then post to other server,
> so, I need to get all raw post data and make a request to other server,
>
> I have tried these ways,
> 1. environ["wsgi.input"].read(content_length)
> none
> 2. environ["wsgi.input"].getvalue()
> none
> 3. webob.Request(environ).body
> none
> 4. webob.Request(environ).body_file.read()
> none
>
> have method can get form post data? please help


One of those last two should have worked. There can be a problem if
something consumes the input and doesn't save it anywhere. WebOb does
save it (or at least try to recreate it, though right now I believe it
doesn't do file uploads, only simple submissions). The Paste form
submission reader doesn't save the input.

You might be able to do environ['wsgi.input'].seek(0) and then read
again. However, will depend on your server.


-- 
Ian Bicking : ianb@??? : http://blog.ianbicking.org

_______________________________________________
Paste-users mailing list
Paste-users@???
http://webwareforpython.org/cgi-bin/mailman/listinfo/paste-users