read image into protorpc message thru endpoints api
google-app-engine, google-cloud-endpoints, python-2.7
Solution
Yes, this is the right strategy. When using Cloud Endpoints, the bytes sent to a `BytesField` must be base64 encoded.
After being sent and validated through Google's API infrastructure, the base64 encoded bytes will be sent along to your `protorpc.remote.Service` class and converted from a base64 string to a native byte-string (instance of `str`) in Python.
So you'll need your clients to take the image bytes and convert them to base64.
To encode a byte string as base64 in Javascript, see How can you encode a string to Base64 in JavaScript?, to do the same in Python, simply call
import base64
base64.b64encode(byte_string)
Problem
To receive a picture from a user into my `@endpoints.method` do I use `messages.BytesField` as in ``` image = messages.BytesField(1) stuff = messages.StringField(2) ```