【发布时间】:2011-02-01 20:37:18
【问题描述】:
我想在应用引擎上构建一个 REST Web 服务。目前我有这个:
from google.appengine.ext import webapp
from google.appengine.ext.webapp import util
class UsersHandler(webapp.RequestHandler):
def get(self, name):
self.response.out.write('Hello '+ name+'!')
def main():
util.run_wsgi_app(application)
#Map url like /rest/users/johnsmith
application = webapp.WSGIApplication([(r'/rest/users/(.*)',UsersHandler)]
debug=True)
if __name__ == '__main__':
main()
例如,当访问路径 /rest/users 时,我想检索我的所有用户。我想我可以通过构建另一个处理程序来做到这一点,但我想知道是否可以在这个处理程序内部做到这一点。
【问题讨论】:
标签: python google-app-engine rest web-applications