Skip to main content

parse_header_string

Function parse_header_string 

Source
pub fn parse_header_string(inputs: &[String]) -> Result<HashMap<String, String>>
Expand description

Parse a list of Key:Value header strings into a HashMap.

Each element is one header in Key:Value form, supplied via a repeated --headers flag (--headers "A:1" --headers "B:2"). One header per flag means header VALUES may freely contain commas (#761) – e.g. a Cookie value like expires=Thu, 01 Jan 2099 is preserved intact, because we no longer split on commas. Empty elements are skipped so a stray flag is harmless.