【发布时间】:2018-08-25 20:45:46
【问题描述】:
是否可以在 Google App Engine 上仅使用 webapp2 和 Python 创建 API?
比如让我的路由/post/123由这个RequestHandler处理:
class ShowPosts(webapp2.RequestHandler):
def get(self):
posts = Post.query().fetch()
# return the post as data (JSON) here as response
当客户端向/post/123 发出宁静请求时,它可以返回数据对象(而不是呈现的 html 页面)。
这可能或推荐吗?
【问题讨论】:
标签: python google-app-engine google-cloud-platform google-cloud-python