Skip to content

Instantly share code, notes, and snippets.

@KevinGimbel
Last active April 2, 2020 12:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KevinGimbel/fbcdfbf8195594a157d7bcee3317d287 to your computer and use it in GitHub Desktop.
Save KevinGimbel/fbcdfbf8195594a157d7bcee3317d287 to your computer and use it in GitHub Desktop.
// dependency as
// reqwest = { version = "0.10", features = ["blocking", "json"] }
use reqwest;
fn main() {
const TOKEN: &str = "actual_token_here";
let client = reqwest::blocking::Client::new();
let res = client
.get("https://api.github.com/repos/actual_user/actual_repo/releases/latest")
.header("Authorization", format!("token {}", TOKEN))
.send()?;
println!("{:#?}", res);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment