Category: requests

Problem

Fetch repo info from GitHub API.

Solution

  r = requests.get("https://api.github.com/repos/python/cpython", headers=headers)
  

Notes

  • Adapt variable names and paths to your project
  • Add error handling for production use
  • See related chapters in the Learning Path