diff options
| author | Teddy Wing | 2021-05-29 14:09:36 +0200 | 
|---|---|---|
| committer | Teddy Wing | 2021-05-29 14:09:36 +0200 | 
| commit | f4a44010a7dc0ad8c5ec236de0310b4f4913daac (patch) | |
| tree | 1e11a8b730efbe2e95f04921f519c9aaa992559d /src | |
| parent | 5ed8648509b6a9b19b654c3b11480efa83c63a11 (diff) | |
| download | reflectub-f4a44010a7dc0ad8c5ec236de0310b4f4913daac.tar.bz2 | |
Make a test request to the GitHub API to get user repos
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.rs | 19 | 
1 files changed, 18 insertions, 1 deletions
| diff --git a/src/main.rs b/src/main.rs index e7a11a9..ded975e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,20 @@ +use reqwest::blocking::Client; + +  fn main() { -    println!("Hello, world!"); +    let client = Client::new(); + +    let response = client.request( +        reqwest::Method::GET, +        format!( +            "https://api.github.com/users/{}/repos", +            "teddywing", +        ), +    ) +        .header("Accept", "application/vnd.github.v3+json") +        .header("User-Agent", "reflectub") +        .send() +        .unwrap(); + +    dbg!(&response);  } | 
