def POST(self): try: data = web.data() UpmpHandler.notify(data) web.header('Content-Type', 'text/html') raise web.OK('success') except InvalidMerchantException: raise web.BadRequest('Invalid merchant') except InvalidNotifyException: raise web.BadRequest('Notify fail') except InvalidContentTypeException: raise web.BadRequest('Invalid content type') except Exception, e: print e raise web.OK('success')