How to authenticate requests with HTTP.jl?



Suppose we want to get information from GitHub API for various users:

using HTTP
for user in users
  resp = HTTP.get("$user")

The code fails for a large number of users due to the reduced rate limits for unauthenticated requests. Can you please explain how one can authenticate these requests with HTTP.jl? I have my GitHub authentication token set and working with GitHub.jl.


GitHub can authenticate you using a personal access token. Once you generate the token, you can just add ?access_token=<YOUR_TOKEN> to the end of the URL and it should work. At least this is what worked for me in PackageTracker.jl.


I’ve done something similar in a project - you’re better off interacting with GitHub through GitHub.jl

It takes a config where you pass your token and it handles authentication for you.


@essenciary, I used GitHub.jl at the time I asked the question:

The notebook is part of our JuliaGraphTutorials repository: