https://github.com/GoogleCloudPlatform/python-docs-samples/blob/da0d097e9e6e2ac1db53491553f7c985c2f7cbf2/appengine/standard/pubsub/main.py#L71 As written currently, the code returns the following error message, since request.data is empty. `raise ValueError("No JSON object could be decoded")` It works if written as `envelope = json.loads(request.get_data().decode('utf-8'))`