Skip to main content

parse_headers_file

Function parse_headers_file 

Source
pub fn parse_headers_file(path: &Path) -> Result<Vec<(String, String)>, String>
Expand description

Parse headers from a file supporting both simple and curl config formats

Supported formats:

  • Simple: Header-Name: Header-Value
  • Curl config: header = Name: Value or -H "Name: Value"
  • Comments: Lines starting with #
  • Blank lines are ignored

Both formats can be mixed in the same file.