Brad Clements wrote: > I've wasted some time today trying to figure out where in my service stack > an http > 405 is being returned. (zope, or my paste service, or the service my paste > service > calls .. ) > > > I finally tracked it down to fileapp.py, specifically DataApp.__call__ which > now > apparently doesn't like to respond to POST requests. > > Can someone explain the logic with this change? An accident maybe when trying > to handle HEAD requests? > > > I receive a REST POST to a resource and I want to return it. I use DataApp to > do > that, but now it doesn't work! > > Why can't POST requests return data? > > Do I have to subclass DataApp, or modify all my code to alter > environ[REQUEST_METHOD] before returning a DataApp object?
Sorry about the slow response. It was noted as a backward incompatible change in 1.2. Generally DataApp and POST don't really fit together -- conceptually they are different. But in Paste trunk (and there will be another release soon) I added an allowed_methods argument that you can give to add POST, like DataApp(..., allowed_methods=['GET', 'HEAD', 'POST']). > For debugging, I would really like a way to get a stack trace when the http > status > code gets set. I have no idea how this could be done, but with so many layers > in a > paste app, it can be very difficult to figure out who is setting the status > code. Ben Bangert has been looking at adding logging throughout Paste, but I don't know how that's going. I think he got distracted. First we would need some basic setup of logging in Paste, so that there's something reasonable to do with the messages. Then we can start adding various messages around > Maybe when an HTTPException object is created (and some debug option has > been set), the exception object could log a traceback right then.. Boy, that > sure > would be handy for tracking down these kinds of problems. Yes, I used to kind of do this by using the HTTP exception middleware to keep it from catching exceptions. But then I stopped actually using it most places, so it stopped working. An option in HTTPExceptions to do something like traceback.print_exc whenever a particular exception object is instantiated would be useful (and accepted -- but with docs, otherwise no one will ever know it's there). It would be strictly for debugging, of course, but useful. Maybe like HTTPMethodNotAllowed.debug_watch(). -- Ian Bicking | [EMAIL PROTECTED] | http://blog.ianbicking.org _______________________________________________ Paste-users mailing list [email protected] http://webwareforpython.org/cgi-bin/mailman/listinfo/paste-users
