pub struct Request {
pub method: Method,
pub scheme: Option<Box<str>>,
pub authority: Option<Box<str>>,
pub path: Option<Box<str>>,
pub query: Option<Box<str>>,
pub protocol: Option<Box<str>>,
pub fields: Fields,
}Expand description
A request: the pseudo-headers of RFC 9114 §4.3, then the fields that followed them.
super::stream builds one out of a decoded field section, which is where
every rule that makes a request malformed is applied: by the time one of
these exists, all of them have been passed. The suite’s client builds them
too, with Request::new, because the pseudo-headers a client sends are the
pseudo-headers a server reads.
Fields§
§method: MethodThe :method pseudo-header.
scheme: Option<Box<str>>The :scheme pseudo-header, which a classic CONNECT omits
(RFC 9114 §4.4).
The authority this request names.
Its :authority pseudo-header, or the Host field where RFC 9114 §4.3.1
lets that stand in for one – the two are required to agree, so which of
them it came from changes nothing downstream.
path: Option<Box<str>>The path part of :path: everything before the first “?”.
RFC 9114 §4.3.1 makes :path “the path and query parts of the target
URI”, and the two are kept apart here because the RFC 9298 template is
one rule about the path and another about the query.
query: Option<Box<str>>The query part of :path: whatever followed the first “?”.
Some("") for a :path ending in “?”, which is a query that is present
and empty rather than one that is absent.
protocol: Option<Box<str>>The :protocol pseudo-header of an extended CONNECT (RFC 8441 §4).
Kept as the token that arrived rather than mapped onto a fixed set, so a protocol this server does not implement can be answered with the 501 RFC 9220 §3 calls for instead of being rejected as malformed before anything has looked at it.
fields: FieldsThe regular field lines, in the order they arrived.