github API check_runs returning 415, "Unsupported Media Type"

Viewed 283

really that simple, making a request with github api: https://docs.github.com/en/rest/reference/checks#list-check-runs-for-a-git-reference

I am trying to find the check runs for a particular branch I have. Below is the url I GET from:

url = ...api/v3/repos/{repo_fullname}/commits/{branch}/check-runs'

Here are my headers:

    headers = {
        'Authorization': 'token ' + token,
        "Accept": "application/vnd.github.v3+json"
    }

I get hit with the: 415 Client Error: Unsupported Media Type for url...

Please help, been banging my head for hours. Thanks!

1 Answers

Perhaps you could try a different accept? I work with octokit for node and this fixed my problem, maybe it would help in this case.

headers = {
    'Authorization': 'token ' + token,
    "Accept": "application/vnd.github.antiope-preview+json"
}
Related