I have an iOS app that is sending fairly large JSON POST parameters (a few hundred characters long) in addition to an image to my App Engine instance via a blobstore url.
For some reason, the JSON string returned by self.request.get('foo') has Carriage Returns (ie, characters with decimal value 13) inserted every 76 characters. This is causing the JSON parser to throw errors about control characters. Why is this happening and is there a way to stop it?
I am fairly certain that my app is not adding these characters, as I used a proxy to inspect the HTTP requests and the JSON string was formatted correctly.
Thanks!
EDIT:
I discovered that it is actually adding =\r\n every 75 characters which lead me to another SO question with a pointer to a bug in App Engine's blobstore.
This is a duplicate of (except it is in webapp2 instead of django): Data gets corrupted on form send, =\r\n introduced in the data every 75 characters?
And the solution is at: Encoding problem in app engine when submitting multipart/form-data forms
This is fixed with webob 1.2.3, that will be available in the next App Engine release: 1.7.4
In the meantime you can deploy webob 1.2.3 with your application by copying the webob
subdirectory contained in their release tarball to your application directory.