httpal 0.1.0

Work in progress: HTTP client for Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::convert::From;

use http::Header;

impl<'a> From<&'a str> for Header {
    fn from(header: &'a str) -> Header {
        let owned_header = header.to_owned().to_lowercase();
        match &*owned_header {
            "host" => Header::Host,
            "content-type" => Header::ContentType,
            "content-length" => Header::ContentLength,
            "transfer-encoding" => Header::TransferEncoding,
            _ => Header::Custom(owned_header),
        }
    }
}