#url #uri #urllib #urlparse

urlparse

This is a URL parsing library like urllib.parse in Python3.x

5 releases

Uses old Rust 2015

0.7.3 Feb 13, 2016
0.7.2 Jan 13, 2016
0.7.1 Jan 7, 2016
0.7.0 Dec 25, 2015
0.6.0 Dec 24, 2015

#253 in Web programming

Download history 529/week @ 2021-01-13 615/week @ 2021-01-20 400/week @ 2021-01-27 388/week @ 2021-02-03 352/week @ 2021-02-10 389/week @ 2021-02-17 622/week @ 2021-02-24 646/week @ 2021-03-03 583/week @ 2021-03-10 680/week @ 2021-03-17 573/week @ 2021-03-24 797/week @ 2021-03-31 952/week @ 2021-04-07 753/week @ 2021-04-14 503/week @ 2021-04-21 427/week @ 2021-04-28

1,580 downloads per month
Used in 12 crates (7 directly)

MIT license

18KB
302 lines

rust-urlparse

Build Status

This is a URL parsing library written in Rust.

The goal of this project is to provide a simple parsing URL library like urllib.parse in Python3.x.

Examples

Source code

extern crate urlparse;
use urlparse::urlparse;
use urlparse::GetQuery;  // Trait

fn main() {
    let url = urlparse("http://www.example.com/foo?bar=123&col=println%21%28%22TEST%21%22%29&col=sub");
    let query = url.get_parsed_query().unwrap();
    println!("{:?}", url);
    println!("{:?}", query.get_first_from_str("col"));
}

Output

Url { scheme: "http", netloc: "www.example.com", path: "/foo", query: Some("bar=123&col=println%21%28%22TEST%21%22%29&col=sub"), fragment: None, username: None, password: None, hostname: Some("www.example.com"), port: None }
Some("println!(\"TEST!\")")

License

MIT

Installation

If you're using Cargo, just add urlparse to your Cargo.toml:

[dependencies.urlparse]
version = "0.7.2"

Documentation

The documentation is hosted online.

No runtime deps