我正在使用 Endpoints Proto Datastore API。假设我有这样的代码:
模型 :
class MyModel(EndpointsModel):
_message_fields_schema = ('name', 'image')
name = ndb.StringProperty()
image = ndb.BlobProperty()
接口:
@endpoints.api(name='myapi', version='v1', description='my api')
class MyApi(remote.Service):
@MyModel.method(name='mymodel.insert', path='mymodel')
def insert_mymodel(self, data):
data.put()
return data
如何通过 api 将图像上传到数据存储区?先感谢您。