Skip to main content

headers

Function headers 

Source
pub fn headers(pairs: &[(&str, &str)]) -> HashMap<String, String>
Expand description

The headers for a request, from the pairs that make them up.

A header map is HashMap<String, String>, and this is the one line that builds one from string literals.

use simpleplatform_sdk::http;

let sending = http::headers(&[
    ("Authorization", "Bearer T"),
    ("Accept", "application/json"),
]);

assert_eq!(sending["Accept"], "application/json");