首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >添加protorpc url变量

添加protorpc url变量
EN

Stack Overflow用户
提问于 2014-08-10 08:43:14
回答 1查看 70关注 0票数 0

有没有办法在protorpc服务路径中添加一个变量?类似于webapp2 url templates

EN

回答 1

Stack Overflow用户

发布于 2014-08-22 04:05:25

我认为您正在寻找一个资源容器:

来自https://developers.google.com/appengine/docs/python/endpoints/getstarted/backend/write_api_post

代码语言:javascript
复制
ID_RESOURCE = endpoints.ResourceContainer:

MULTIPLY_METHOD_RESOURCE = endpoints.ResourceContainer(
        Greeting,
        times=messages.IntegerField(2, variant=messages.Variant.INT32,
                                    required=True))

@endpoints.method(MULTIPLY_METHOD_RESOURCE, Greeting,
                  path='hellogreeting/{times}', http_method='POST',
                  name='greetings.multiply')
def greetings_multiply(self, request):
    return Greeting(message=request.message * request.times)
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/25224493

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档