Skip to content

Instantly share code, notes, and snippets.

@woochica
Last active November 22, 2021 16:19
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 woochica/17756ad8a8ce0cfbebae4343902577bf to your computer and use it in GitHub Desktop.
Save woochica/17756ad8a8ce0cfbebae4343902577bf to your computer and use it in GitHub Desktop.
Hello package.elm-lang.org
//! 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