Last active
November 22, 2021 16:19
-
-
Save woochica/17756ad8a8ce0cfbebae4343902577bf to your computer and use it in GitHub Desktop.
Hello package.elm-lang.org
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//! Another simple example that creates a custom HTTP client instance and sends | |
//! a GET request with it instead of using the default client. | |
use isahc::{prelude::*, HttpClient}; | |
use std::{ | |
io::{copy, stdout}, | |
}; | |
fn main() -> Result<(), isahc::Error> { | |
let url = format!("https://package.elm-lang.org/all-packages/since/{}", 0); | |
let mut response = isahc::get(url)?; | |
copy(response.body_mut(), &mut stdout())?; | |
Ok(()) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment