Using google-api-python-client 2.2.0 and the GCP monitoring API, I received an error when retrieving the second page of a projects.timeSeries.query call:
can't fetch data, reason: Invalid JSON payload received. Unexpected end of string. Expected an object key or }.
Turns out that the content-length header is wrong and doesn't match with the body with the additional pageToken field.
The problem is in https://github.com/googleapis/google-api-python-client/blob/master/googleapiclient/discovery.py#L1285: the body is replaced, but the content-length stays the same because it is only updated at Request object creation time. I will prepare a PR for this.
Using google-api-python-client 2.2.0 and the GCP monitoring API, I received an error when retrieving the second page of a projects.timeSeries.query call:
Turns out that the content-length header is wrong and doesn't match with the body with the additional pageToken field.
The problem is in https://github.com/googleapis/google-api-python-client/blob/master/googleapiclient/discovery.py#L1285: the body is replaced, but the content-length stays the same because it is only updated at Request object creation time. I will prepare a PR for this.