Function ehttp::headers

source ·
pub fn headers(headers: &[(&str, &str)]) -> BTreeMap<String, String>
Expand description

Helper for constructing Request::headers.

use ehttp::Request;
let request = Request {
    headers: ehttp::headers(&[
        ("Accept", "*/*"),
        ("Content-Type", "text/plain; charset=utf-8"),
    ]),
    ..Request::get("https://www.example.com")
};