Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
sungengyi opened this issue Aug 24, 2023 · 0 comments
Open

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

sungengyi opened this issue Aug 24, 2023 · 0 comments
Assignees

Comments

@sungengyi
Copy link

sungengyi commented Aug 24, 2023

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] +']}')

@kbatuigas kbatuigas self-assigned this Aug 30, 2023
@kbatuigas kbatuigas removed their assignment Sep 25, 2023
@rosieyohannan rosieyohannan self-assigned this Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants