pub struct Request<'a> {
pub method: &'a str,
pub host: &'a str,
pub port: u16,
pub path: &'a str,
pub headers: &'a [(&'a str, &'a str)],
pub body: &'a [u8],
}Expand description
One request.
Headers are the caller’s: Client::send adds the three every request
needs (Host, Connection: close, User-Agent) and Content-Length
for a body, and has no opinion about the rest.
Fields§
§method: &'a strHTTP method, uppercase.
host: &'a strHost name, used for DNS, the Host header and TLS server-name
verification alike — the same name in all three, which is what makes
the certificate check mean anything.
port: u16TCP port; 443 unless the endpoint is somewhere unusual.
path: &'a strRequest target, beginning with /.
headers: &'a [(&'a str, &'a str)]Extra headers, as name/value pairs. Values must not contain CR or
LF — see config::value::word, which refuses any value that could
end one header and begin another.
body: &'a [u8]The body. Content-Length is sent for anything but a GET.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Request<'a>
impl<'a> RefUnwindSafe for Request<'a>
impl<'a> Send for Request<'a>
impl<'a> Sync for Request<'a>
impl<'a> Unpin for Request<'a>
impl<'a> UnsafeUnpin for Request<'a>
impl<'a> UnwindSafe for Request<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more