Skip to content

REST API Response cannot be parsed by JSON and possible solution #8308

Open
@sungengyi

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
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions