REST API Response cannot be parsed by JSON and possible solution #8308
Open
Description
Description
When using API v1.1 to query build tests, the returned response occationally cannot be parsed by json.
Location
like this one: https://circleci.com/api/v1.1/project/gh/driftx/cassandra/16701/tests
due to an extra '\n{"message":"Internal server error."}' at the end.
Steps to Reproduce
response = requests.get(url, headers=ci_headers)
result = json.loads(response.text)
or
response.json()
return "JSONDecodeError: Expecting ',' delimiter"
My Temp Solution
json.loads(response.text[:-37] +']}')
Metadata
Assignees
Labels
No labels