I'm trying to get the latest version of Nomad from official Github hashicorp repo. (written the explicit url for the version assets for the sake of the question)
import requests
response = requests.get("https://api.github.com/repos/hashicorp/nomad/releases/latest")
release_url = response.json()["url"]
print(release_url)
asset_response = requests.get("https://api.github.com/repos/hashicorp/nomad/releases/assets/57485344", headers={"Accept": "application/octet-stream; application/vnd.github.v3+json"})
print(asset_response.json())
When running the code I'm getting error Not Found:
{'message': 'Not Found', 'documentation_url': 'https://docs.github.com/rest/reference/repos#get-a-release-asset'}
I've also tried setting the Accept header to "application/octet-stream" as it states in the docs and I'm getting the same exact error.
In addition, tried using the browser with the same url and I'm getting the same error, so I'm guessing the issue is not likely to be with python requests.
Am I doing something wrong here? Or is there another way to get the latest precompiled binary of the latest version using the GitHub API?