Crate urlparse

Source
Expand description

This is a URL parsing library.

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

§Examples

use urlparse::urlparse;
use urlparse::GetQuery;  // Trait

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();
assert_eq!(url.scheme, "http");
assert_eq!(query.get_first_from_str("col").unwrap(), "println!(\"TEST!\")");

Structs§

Url

Traits§

GetQuery

Functions§

parse_qs
Parses a query given as a string argument.
quote
Replaces special characters in string using the %xx escape. Letters, digits, and the characters ‘_.-’ are never quoted.
quote_plus
Like quote(), but also replaces ’ ’ with ‘+’, as required for quoting HTML form values.
unquote
Replaces %xx escapes by their single-character equivalent.
unquote_plus
Like unquote(), but also replaces plus signs by spaces, as required for unquoting HTML form values.
urlparse
Parses a URL and returns a Url object. This is synonymous with Url::parse().
urlunparse
Returns a URL string from a Url object. This is synonymous with unparse() defined in Url.

Type Aliases§

Query
An alias type of HashMap<String, QueryValue>.
QueryValue
An alias type of Vec<String>.