Enum tk_http::server::RequestTarget
[−]
[src]
pub enum RequestTarget<'a> { Origin(&'a str), Absolute { scheme: &'a str, authority: &'a str, path: &'a str, }, Authority(&'a str), Asterisk, }
A middle part of the request line
Most people get used to having path there or maybe asterisk. But in the real protocol there are all four options.
You don't have to implement all of them though. Using Head::path()
provides good shortcut for handling Origin
and Absolute
in uniform
way and Authority
is useful only for (non-reverse, ) proxies.
Variants
Origin(&'a str)
Usual form of /hello?name=world
Absolute
Full url: http://example.com:8080/hello
Note in this case (unlike in Origin) path may not start with a slash
Fields of Absolute
scheme: &'a str | Scheme, might be |
Authority is basically | |
path: &'a str | Path relative to root, it's not normalized, so might be empty |
Authority(&'a str)
Only hostname example.com:8080
, only useful for CONNECT
method
Asterisk
Asterisk *