Function parse_to_reqwest_header
Source pub fn parse_to_reqwest_header(
header: &str,
) -> Result<HeaderInfo, Box<dyn Error>>
Expand description
let req = r##"
GET / HTTP/1.1
Host: crates.io
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.5249.119 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Referer: https://crates.io/
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.9
Connection: close
"##;
let info = parse_to_reqwest_header(req).unwrap();
let method = info.method;
let url = info.url;
let header = info.header;