Although the code has the Github token included, for some reason I am still unable to avail more GitHub Rest API quota.
I am using Reqwest for Rust to process all requests. I believe that I may be entering my token incorrectly.
The Code
let mut headers = HeaderMap::new();
headers.insert(USER_AGENT, HeaderValue::from_static("SBSixteen"));
headers.insert(AUTHORIZATION,HeaderValue::from_static("github_pat_****************************************************") );
let client = Client::builder().default_headers(headers).build().unwrap();
let url = format!("https://api.github.com/users/{}",data.git_username);
println!("{}", &url);
let r1 = client.get(&url).send().await.unwrap().text().await.unwrap();
println!("{}", &r1);
The Error
{"message":"API rate limit exceeded for ***.***.**.*. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)","documentation_url":"https://docs.github.com/rest/overview/resources-in-the-rest-api#rate-limiting"}
thread 'tokio-runtime-worker' panicked at 'called `Option::unwrap()` on a `None` value', src\NER_EZH.rs:632:38
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
I tried multiple possible combinations but I am unable to set my token correctly.