shell-download 0.22.1

Zero-dependency Rust library for downloading a remote URL to a file, string or bytes using commonly-available shell tools.
Documentation
use shell_download::RequestBuilder;

#[test]
fn fetch_string() {
    let url = "https://httpbin.org/get";
    let body = RequestBuilder::new(url)
        .fetch_string()
        .expect("fetch failed");
    assert!(body.contains("\"url\": \"https://httpbin.org/get\""));
}

#[test]
fn fetch_bytes() {
    let url = "https://httpbin.org/get";
    let body = RequestBuilder::new(url)
        .fetch_bytes()
        .expect("fetch failed");
    assert!(
        body.windows(b"\"url\": \"https://httpbin.org/get\"".len())
            .any(|w| w == b"\"url\": \"https://httpbin.org/get\"")
    );
}