Home
Head's Up: I'm in the middle of upgrading my site. Most things are in place, but there are something missing and/or broken including image alt text. Please bear with me while I'm getting things fixed.

Get Querystring Params From A URL In Rust

This is what I'm doing to get query params in Rust :

rust
use url::Url;

fn main() {
    let url = Url::parse("https://www.example.com/index.html?alfa=bravo&charlie=delta")
        .expect("Could not parse url");
    let query_pairs = url.query_pairs();
    query_pairs.for_each(|param| {
        println!("key: {}, value: {}", param.0, param.1);
        ()
    });
}

This uses the url create (which has 104 million downloads)