I am using Endpoints Proto Datastore API. Suppose I have code like this :
Model :
class MyModel(EndpointsModel):
_message_fields_schema = ('name', 'image')
name = ndb.StringProperty()
image = ndb.BlobProperty()
API :
@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
How can I upload image to the datastore through api? Thank you in advance.