Neil napisal(a):
> Robert, you may wish to check out this topic:
> http://groups.google.com/group/pylons-discuss/browse_thread/thread/156a6734c52e481c
>
> I've managed to get other methods working by doing the following:
>
> a) make sure you are using paste#http as the server (check
> development.ini)
OK, that was enough - figured it out already
> b) modify httpserver.py to handle other request methods (here is an
> example of just adding support for OPTIONS). This basically routes
> incoming requests for the methods listed below to the Pylons wsgi app
>
> do_OPTIONS = do_POST = do_GET = do_HEAD = do_DELETE = do_PUT = do_TRACE
> = \
> WSGIHandlerMixin.wsgi_execute
Was not necessary. POST, PUT and DELETE just work (and GET, obviously).
Don't know about HEAD though. These are enough for me.
> c) I had some indirectly-related problems with middleware consuming
> environ['wsgi.input'] and the Myghty request object subsequently
> hanging when it attempted to read from it.. as a workaround I modified
I've noticed that problem. Processing of request body seems a bit
convoluted to me. It's about to change in 0.9, right?
> wsgiapp.py at line 27 as shown below. Apparently this will not be an
> issue with the 0.9 release. There is another workaround in the topic I
> linked to at the beginning of this post.
>
> try:
> if environ.get('REQUEST_METHOD') == 'OPTIONS':
> from StringIO import StringIO
> environ['wsgi.input'] = StringIO('')
>
> return self.app.handle(environ, start_response)
>
> HTH
> Neil
Thanks!
OK, almost everything's fine. How do I get access to POST's request
body? My scenario is that the incoming data has content-type text/plain
(could be application/xml or whatever in the future) as I'm developing
a simple REST service. I know that the automagic works for web form
submissions, but I need the raw body, well, there's not much to process
there anyway. Any suggestions?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" 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/pylons-discuss
-~----------~----~----~----~------~----~------~--~---