leyline-http 0.1.1

HTTP client that mimics browsers on the wire
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use super::*;

#[test]
fn url_encode_simple() {
    assert_eq!(url_encode("hello world"), "hello+world");
    assert_eq!(url_encode("a=b&c=d"), "a%3Db%26c%3Dd");
    assert_eq!(url_encode("safe-string_v2.0"), "safe-string_v2.0");
}

#[test]
fn url_encode_pairs_works() {
    let pairs = url_encode_pairs(&[
        ("user".to_string(), "alice".to_string()),
        ("pass".to_string(), "s3cr3t!".to_string()),
    ]);
    assert_eq!(pairs, "user=alice&pass=s3cr3t%21");
}