是否可以在 google 云端点 python 中 return 字符串
is it possible to return string in google cloud endpoints python
我需要 return 一个字符串(纯文本)而不是 JSON(class 消息)。
这是我的代码:
@endpoints.method(
# This method takes a ResourceContainer defined above.
Site_resource,
# This method returns an Echo message.
Site_response_new,
path='test',
http_method='POST',
name='testsystem')
def testsystem(self, request):
return Site_response_new(result=data)
我想做:
@endpoints.method(
# This method takes a ResourceContainer defined above.
Site_resource,
# This method returns an Echo message.
str,
path='test',
http_method='POST',
name='testsystem')
def testsystem(self, request):
return "awesome string"
谢谢<3
不,目前不可能。
我需要 return 一个字符串(纯文本)而不是 JSON(class 消息)。
这是我的代码:
@endpoints.method(
# This method takes a ResourceContainer defined above.
Site_resource,
# This method returns an Echo message.
Site_response_new,
path='test',
http_method='POST',
name='testsystem')
def testsystem(self, request):
return Site_response_new(result=data)
我想做:
@endpoints.method(
# This method takes a ResourceContainer defined above.
Site_resource,
# This method returns an Echo message.
str,
path='test',
http_method='POST',
name='testsystem')
def testsystem(self, request):
return "awesome string"
谢谢<3
不,目前不可能。