Is there a way to add a variable in the protorpc service path? Similar to webapp2 url templates.
0
votes
1 Answers
0
votes
I think you are looking for a resource container:
from https://developers.google.com/appengine/docs/python/endpoints/getstarted/backend/write_api_post
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)