pub struct Request {
pub remote_addr: SocketAddr,
pub method: String,
pub url: Url,
pub headers: HeaderList,
pub cookies: HashMap<String, String>,
pub content_type: ContentType,
pub expect_continue: bool,
pub chunked: bool,
pub gzip: bool,
pub content_length: Option<u64>,
pub body: RequestBody,
}
Fields
remote_addr: SocketAddr
method: String
url: Url
headers: HeaderList
content_type: ContentType
expect_continue: bool
chunked: bool
gzip: bool
content_length: Option<u64>
body: RequestBody
Implementations
sourceimpl Request
impl Request
pub fn body(&self) -> &RequestBody
pub fn content_type(&self) -> &ContentType
pub fn method(&self) -> &str
pub fn url(&self) -> &Url
sourcepub fn recv_body(self, max_len: u64) -> Result<Request, Response>
pub fn recv_body(self, max_len: u64) -> Result<Request, Response>
Errors
Returns an error when the request body length is known and it is larger than max_len
.
When the request body is not known, this returns Response::get_body_and_reprocess(max_len)
.
The server then tries to read the request body.
If it reads more than max_len
bytes, it stops and returns 413 Payload Too Large
.
Trait Implementations
impl Eq for Request
impl StructuralEq for Request
impl StructuralPartialEq for Request
Auto Trait Implementations
impl RefUnwindSafe for Request
impl Send for Request
impl Sync for Request
impl Unpin for Request
impl UnwindSafe for Request
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more