-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Closed
Labels
priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
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.
Metadata
Metadata
Assignees
Labels
priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.