reqwest
reqwest copied to clipboard
InvalidHeaderName
the reqwest report errors when add the following headers:
:method: GET
:scheme: https
:authority: raw.githubusercontent.com
:path: txtx
the code to test:
let mut h = header::HeaderMap::new();
h.insert(":authority", header::HeaderValue::from_static(
"raw.githubusercontent.com"));
panic:
panicked at 'static str is invalid name: InvalidHeaderName'
How to add http headers prefix ":" showed above? thanks a lot!
The HTTP2 pseudo headers will be set automatically if the connection is h2.